Drug-induced liver injury (DILI) is a potential complication of any prescribed medication. So far, the diagnosis of DILI is still a clinical challenge due to the lack of efficient diagnosis method. Glutathione S-transferase (GST), with a high concentration in liver cytosol, can reduce toxicity and facilitate urinary excretion by catalyzing the conjugation of glutathione (GSH) with reactive metabolites in liver. When liver is seriously damaged, GST and GSH will be released into plasma from liver cytosol, which caused a lower GST activity in liver cytosol. Therefore, monitoring the level of GST activity in liver tissue may be a potential strategy for diagnosis of DILI. Here, we reported a two-photon probe P-GST for GST activity detection for the first time. In the proposed design, a donor-π-acceptor (D-π-A) structured naphthalimide derivative with efficient two-photon properties was chosen as the fluorescent group, and a 2,4-dinitrobenzenesulfonate group was employed as the GST recognition unit, which also acted as the fluorescence quencher. In the present of GST and GSH, the recognition unit was removed and the fluorophore was released, causing a 40-fold enhancement of fluorescence signal with a detection limit of 35 ng/mL. At last, P-GST was successfully applied in two-photon imaging of GST in cells and DILI samples, which demonstrated its practical application in complex biosystems as a potential method for diagnosis of DILI.