The output of a piezoelectric nanogenerator (NG) fabricated using ZnO nanowire arrays is largely influenced by the density of the surface charge carriers at the nanowire surfaces. Adsorption of gas molecules could modify the surface carrier density through a screening effect, thus, the output of the NG is sensitive to the gas concentration. Based on such a mechanism, we first studied the responses of an unpackaged NG to oxygen, H2S and water vapor, and demonstrated its sensitivity to H2S to a level as low as 100 ppm. Therefore, the piezoelectric signal generated by a ZnO NWs NG can act not only as a power source, but also as a response signal to the gas, demonstrating a possible approach as a self-powered active gas sensor.