A rhodamine-inspired fluorescence dye (2) bearing 7-diethylaminocoumarin fluorophore was designed as a platform for the construction of an NIR and ratiometric fluorescent probe. The ring-open form of 2 shows NIR absorption and emission; however, its ring-closed form displays the visible absorption and emission because an intact 7-diethylaminocoumarin fluorophore was involved in the structure, providing the basis for an NIR and ratiometric fluorescent platform based on the spirocyclization-induced fluorescence switching mechanism. With the platform, we developed a novel NIR and ratiometric fluorescent probe R1, a thiolactone of 2, for sensing Hg2+, an environmentally and biologically concerned species. R1 displays an emission peak with the maximum at 480 nm, which is the typical emission of 7-diethylaminocoumarin moiety; however, upon addition of Hg2+ ions, the emission intensity at 480 nm gradually decreased with the simultaneous appearance of a new NIR emission band centred at 695 nm. Thus, the Hg2+-promoted ratiometric fluorescence response can be realized. The high selectivity towards Hg2+ over various cations and the high stability in a wide pH range of 1–12 indicate its potential for applications in biological systems. The subsequent cell imaging experiment revealed that R1 is cell permeable, and could be employed for ratiometric fluorescence imaging of Hg2+ in living cells.