We reported a ratiometric two-photon fluorescent probe (SG1) for β-galactosidase (β-gal) and its application to quantitative detection of β-gal activity during cellular senescence in live cells and in aged tissues. This probe is characterized by a significant two-photon excited fluorescence, a marked blue-to-yellow emission color change in response to β-gal, easy loading, insensitivity to pH and reactive oxygen species (ROS), high photostability, and low cytotoxicity. In addition, we show that SG1 labeling is an effective tool for quantitative detection of senescence-associated β-gal activity at the subcellular level in situ. This finding demonstrates that SG1 will find useful applications in biomedical research, including studies of cell aging.