Specific detection of 2,4,6-trinitrophenol (TNP) is of fundamental importance for homeland security and environmental safety. Turn-off fluorescence sensors for TNP based on small organic fluorophores are gaining increasing attention for their excellent sensitivity and low cost. In experiment, the turn-off signal is generally attributed to the hydrogen bond-assisted charge transfer mechanism, in which the intermolecular hydrogen bond facilitates the photoinduced electron transfer (PeT) between the sensor and analyte. However, detailed computational works are usually not present to support this mechanism. This study performs a thorough investigation on the turn-off mechanism of a pyrene-based probe (PTC) for TNP with the aid of density functional theory (DFT) and time-dependent DFT (TDDFT) methods, presenting a novel π-π stacking-assisted PeT mechanism rather than the original hydrogen bond-assisted PeT mechanism. The investigation reveals that the π-π stacking model plants a lower-lying PeT state under the local excitation (LE) state of the PTC. π-π stacking, on one hand, enlarges the LUMO-LUMO gap between TNP and PTC; on the other, it renders considerable orbital overlap between the two LUMOs, which facilitates facile electron transfer from PTC to TNP and leads to fluorescence quenching. Moreover, the selectivity of the sensor in the presence of interfering nitro-aromatic compounds (NACs) is studied by taking nitrobenzene (NB) as an example. A similar PeT state is planted under the LE state in this case. However, for the first time, we observe a crossover of the PeT state and the LE state induced by NB. After photoexcitation, the PTC-NB complex will partially relax to the LE minimum via the minimal energy conical intersection (MECI) and the fluorescence is recovered. The selectivity of the sensor is well explained. This work expands our understanding of the effects of hydrogen bond and π-π stacking on the PeT process and provides new insights for the design of pyrene-based TNP sensors.