Near-infrared (NIR) detection plays an irreplaceable role in fields such as biomedical imaging, food and agricultural testing, and materials analysis. However, the application of NIR detection technology is greatly limited by the shortcomings of traditional detection techniques, including insufficient sensitivity, high equipment costs, and sensitivity to environmental conditions. To address these challenges, a novel 3D-printed luminescent thin film for NIR detection was developed, providing a low-cost, highly sensitive, and robust alternative for NIR detection. In this research, a rare-earth-doped luminescent material was prepared for NIR detection firstly. The presence of rare-earth elements gives the luminescent material tunable emission spectra, strong chemical and thermal stability, and high luminous efficiency. Traditional thin film manufacturing methods are often complex and costly, however, by leveraging the flexible design capabilities and high-precision processing characteristics of 3D printing, then, luminescent material was fabricated into thin film with high uniformity and adjustable performance. Experimental results demonstrate that this 3D-printed luminescent thin film exhibits exceptional sensitivity and stability in NIR detection. Compared to traditional methods, this technology not only simplifies the thin film fabrication process but also significantly reduces costs, offering promising prospects for practical applications.