Merocyanines adsorbed into the mesopores of mSiO2 shell of NaYF4: 20% Yb, 2% Er, 0.2% Tm nanocrystals are demonstrated as ratiometric upconversion luminescence (UCL) probe for highly selective detection of HS(-) in living cells through inhibition of energy transfer from the UCL of the nanocrystals to the absorbance of the merocyanines. The UCL probe has been used for ratiometric sensing of H2S with high sensitivity and selectivity.