Elastase is essential for the pathological processes of inflammation and diabetes. Here, a novel near-infrared (NIR) fluorescent probe YZ5F was developed; this probe displays outstanding specificity and sensitivity in detecting elastase activity. It employs xanthene-anthracene hybrid scaffold (YZ-NH2) as the core emissive structure and uses pentafluoropropionamide (an elastase substrate) as the response-triggering moiety. Upon the elastase-catalyzed hydrolytic cleavage of the amide linkage within the probe's conformation, fluorescence emission at wavelength of 725 nm is significantly enhanced, thereby enabling the dynamic monitoring of elastase activity in vitro. Following pretreatment with the inflammation inducer lipopolysaccharide (LPS), the intracellular red fluorescence signal of YZ5F was significantly intensified. Conversely, when cells were pretreated with the inhibitor sivelestat, the fluorescence signal was markedly attenuated. In a streptozotocin-induced diabetic mouse model, the probe demonstrated a greater fluorescence signal compared with that observed in healthy mice, demonstrating its capability to monitor abnormal changes in elastase activity in vivo in real-time. Furthermore, as the therapeutic dosage of insulin administered to the diabetic mice increased, the NIR fluorescence signal within the mice gradually diminished. The Probe was also utilized for fluorescence optical imaging analysis of liver and kidney tissue sections; relative to the group treated with insulin, the diabetic group that received no pharmacological intervention exhibited significantly stronger fluorescence signals. Consequently, YZ5F provides a solid foundation for the early diagnosis, therapeutic efficacy assessment, and drug screening associated with inflammation-related diseases and diabetes.