There is a potential synergistic effect between nonsteroidal anti-inflammatory drugs and hydrogen sulfide (H2S), but direct evidence for the study is lacking. With a single fluorescence detection method, it is difficult to accurately confirm the effectiveness of the synergistic effect. In this study, the fluorescent probe and the nonsteroidal anti-inflammatory drug naproxen were combined via different self-immolative spacer groups to obtain a diagnostic and therapeutic integrated fluorescent probe Nap-NP-NSB, which can release H2S. The quantitative release of H2S by Nap-NP-NSB was evaluated in vitro and in cells, and the synergistic effect of H2S and naproxen was confirmed by monitoring the treatment process of cellular inflammation and oxidative damage of gastric mucosa cells. Finally, in vivo fluorescence imaging and mass spectrometry imaging of the liver and stomach tissues and their sections were performed in the mouse model of acute hepatitis. The dual-modal detection method not only confirmed that Nap-NP-NSB had better anti-inflammatory activity and less gastric mucosal damage, but also enabled a more accurate visualization of the drug synergistic effect of naproxen and H2S. This work provides a dual visualization imaging method combining fluorescence and mass spectrometry imaging and develops a new idea for studying drug synergies based on self-immolative structures.