In practice, the application of the majority of carbon dots (CDs) has been limited in biomedical and bioimaging because of insufficient excitation/emission in near-infrared (NIR) regions. Near-infrared carbon dots (NIR-CDs) benefit from distinctive merits of low toxicity, strong biological penetration, minor susceptibility to the endogenous substances, and ameliorated NIR excitation/emission. Herein, multifunctional dual-emissive near-infrared carbon dots (dNIR-CDs) with intense NIR excitation/ emission are synthesized and subsequently utilized for the construction of a ratiometric nanosensor for rapid and sensitive detection of lysozyme (LYZ). When LYZ was exposed to the nanosensor, fluorescence quenching occurred quickly at the emission peak of 680 nm by the dynamic quenching mechanism, while the fluorescence intensity of the emission peak of 460 nm remained unchanged. The developed nanosensor exhibited a wide linear response within the range of 0.03−10 μM and a reproducible detection limit at the level down to 7 nM for LYZ. By virtue of the high selectivity and sensitivity of the nanosensor, LYZ can be detected at trace levels in complicated human urine samples. Furthermore, the high throughput of the nanosensor for cell imaging is demonstrated.