Cytochrome P450 1A (CYP1A), one of the most important phase I drug-metabolizing enzymes in humans, plays a crucial role in the metabolic activation of procarcinogenic compounds to their ultimate carcinogens. Herein, we reported the development of a ratiometric two-photon fluorescent probe NCMN that allowed for selective and sensitive detection of CYP1A for the first time. The probe was designed on the basis of substrate preference of CYP1A and its high capacity for O-dealkylation, while 1,8-naphthalimide was selected as fluorophore because of its two-photon absorption properties. To achieve a highly selective probe for CYP1A, a series of 1,8-naphthalimide derivatives were synthesized and used to explore the potential structure-selectivity relationship, by using a panel of human CYP isoforms for selectivity screening. After screening and optimization, NCMN displayed the best combination of selectivity, sensitivity and ratiometric fluorescence response following CYP1A-catalyzed O-demetylation. Furthermore, the probe can be used to real-time monitor the enzyme activity of CYP1A in complex biological systems, and it has the potential for rapid screening of CYP1A modulators using tissue preparation as enzyme sources. NCMN has also been successfully used for two-photon imaging of intracellular CYP1A in living cells and tissues, and showed high ratiometric imaging resolution and deep-tissue imaging depth. In summary, a two-photon excited ratiometric fluorescent probe NCMN has been developed and well-characterized for sensitive and selective detection of CYP1A, which holds great promise for bioimaging of endogenous CYP1A in living cells and for further investigation on CYP1A associated biological functions in complex biological systems.