Rare-earth (RE) doped nanocomposites emit visible luminescence when illuminated with continuous wave near-infrared light, making them appealing candidates for use as contrast agents in biomedical imaging. However, the emission lifetime of these materials is much longer than the pixel dwell times used in scanning intravital microscopy. To overcome this limitation, we have developed a line-scanning confocal microscope for high-resolution, optically sectioned imaging of samples labeled with RE-based nanomaterials. Instrument performance is quantified using calibrated test objects. nanocomposites are imaged in vitro, and in ex vivo tissue specimens, with direct comparison to point-scanning confocal microscopy. We demonstrate that the extended pixel dwell time of line-scanning confocal microscopy enables subcellular-level imaging of these nanomaterials while maintaining optical sectioning. The line-scanning approach thus enables microscopic imaging of this emerging class of contrast agents for preclinical studies, with the potential to be adapted for real-time in vivo imaging in the clinic.