The influence of humidity on the NH3 detection capability of S- and N-containing nanoporous carbons was examined for the first time. To investigate the role of water on the electrical performance of the sensors, the sensing tests were carried out using a flow of NH3 diluted in moist air. The same tests were also carried out by performing a 2 h prehumidification prior to the exposure of the carbons to the moist gas stream. Compared to dry conditions, the presence of water in the air stream led to an enhanced response of the sensor. On the other hand, upon the prehumidification the adsorbent's surface an opposite outcome was recorded. Based on the electrical behavior of the carbons and their extensive surface characterization, a complex sensing mechanism is proposed. This mechanism includes specific interactions of NH3 and H2O molecules with surface functionalities, such as hydrogen bonding, proton transport through ionic conductivity, and electron–hole conductivity.