Acidic pH inside cells indicates cellular dysfunctions such as cancer. Therefore, the development of optical pH sensors for measuring and imaging intracellular pH is a demanding challenge. The available pH-sensitive probes are vulnerable to e.g. photobleaching or autofluorescence background in biological materials. Our approach circumvents these problems due to near infrared excitation and upconversion photoluminescence. We introduce a nanosensor based on upconversion resonance energy transfer (UC-RET) between an upconverting nanoparticle (UCNP) and a fluorogenic pH-dependent dye pHrodo™ Red that was covalently bound to the aminosilane surface of the nanoparticles. The sensitized fluorescence of the pHrodo™ Red dye increases strongly with decreasing pH. By referencing the pH-dependent emission of pHrodo™ Red with the pH-insensitive upconversion photoluminescence of the UCNP, we developed a pH-sensor which exhibits a dynamic range from pH 7.2 to 2.5. The applicability of the introduced pH nanosensor for pH imaging was demonstrated by imaging the two emission wavelengths of the nanoprobe in living HeLa cells with a confocal fluorescence microscope upon 980 nm excitation. This demonstrates that the presented pH-nanoprobe can be used as an intracellular pH-sensor due to the unique features of UCNPs: excitation with deeply penetrating near-infrared light, high photostability, lack of autofluorescence and biocompatibility due to an aminosilane coating.