Hydrogen sulfide (H2S) and thiophenol (PhSH) are toxic pollutants that can affect the quality and safety of food and water. It is of importance to detect these analytes. However, developing fluorescent probes that can selectively discriminate H2S and PhSH is challenging due to their similar reactivity. In this work, we reported a dual-functional probe N-(4-(benzo[d]thiazol-2-yl)phenyl)− 2,4-dinitrobenzenesulfonamide (NBT) that could synchronously and selectively respond to H2S and PhSH in different solvents. NBT exhibited high selectivity, a low detection limit (82.66 nM for H2S, 21.44 nM for PhSH), and a wide linear range (5–70 μM for H2S, 5–35 μM for PhSH). Therefore, NBT was successfully applied to detect H2S and PhSH in water and beer samples with excellent recovery and precision. This probe provides a simple and effective method for the simultaneous and quantitative detection of H2S and PhSH in water and beer samples without the need for sophisticated instruments.