Sulfur dioxide (SO2), as a significant gas signal substance, plays an imperative physiological function in life systems and participates in a variety of metabolic pathways. Relevant research has found that SO2, as a reducing agent, may play an important role in protecting cells from endoplasmic reticulum (ER) stress. Therefore, studying the changes of SO2 in cells under ER stress is extremely valuable. But so far, developing an effective near-infrared (NIR) fluorescent probe to detect SO2 in the ER stress remains a major challenge. In this paper, the first near-infrared (NIR) fluorescent probe (MSO-SO2) targeted to the ER was constructed to recognize SO2. The probe MSO-SO2 with dicyanoisophorone derivative as the fluorescent parent is based on the deprotection reaction site mediated by SO2 as the response group (levulinic acid), which was applied for highly selective and sensitive detection for SO2. Furthermore, the biological trials have found that the unique probe targets ER well and has been effectively implemented in the living systems for SO2 imagery. Most importantly, the production and consumption of SO2 were discovered, for the first time, in dithiothreitol-induced ER stress by using the novel probe, which is beneficial for revealing the role of SO2 in ER-associated diseases.