Motivated by the recent realization of cluster-assembled nanomaterials as gas sensors, first-principles calculations are carried out to explore the stability and electronic properties of Zn12O12 cluster-assembled nanowires and the adsorption behaviors of environmental gases on the Zn12O12-based nanowires, including CO, NO, NO2, SO2, NH3, CH4, CO2, O2 and H2. Our results indicate that the ultrathin Zn12O12 cluster-assembled nanowires are particularly thermodynamic stable at room temperature. The CO, NO, NO2, SO2, and NH3 molecules are all chemisorbed on the Zn12O12-based nanowires with reasonable adsorption energies, but CH4, CO2, O2 and H2 molecules are only physically adsorbed on the nanowire. The electronic properties of the Zn12O12-based nanowire present dramatic changes after the adsorption of the NO and NO2 molecules, especially their electric conductivity and magnetic properties, however, the other molecules adsorption hardly change the electric conductivity of the nanowire. Meanwhile, the recovery time of the nanowire sensor at T = 300 K is estimated at 1.5 μs and 16.7 μs for NO and NO2 molecules, respectively. Furthermore, the sensitivities of NO and NO2 are much larger than that of the other molecules. Our results thus conclude that the Zn12O12-based nanowire is a potential candidate for gas sensors with highly sensitivity for NO and NO2.