Triboelectric nanogenerators attract more and more research attention, for their high efficiency, low fabrication cost, and high flexibility. However, the mechanism about triboelectrification remains highly debated. In this work, we constructed a liquid-metal based triboelectric nanogenerator (LM-TENG) and investigated the influence of the gas atmosphere on the triboelectrification between the liquid metal and the dielectric materials, such as PTFE, Kapton, and Nylon. It was found that the dielectric materials were negatively charged on contact with the liquid metal in ambient air. But in the nitrogen conditions, the polarity of the charges was reversed. Oxygen was excluded, which is responsible for the polarity reversal in contact electrification. Based on X-ray photoelectron spectroscopy, energy-dispersive X-ray, and SKFM data, a possible mechanism was proposed.