One-dimensional nanobeam mass sensors offer an unprecedented ability to measure tiny masses or even the mass of individual molecules or atoms, enabling many interesting applications in the fields of mass spectrometry and atomic physics. However, current nano-beam mass sensors suffer from poor real-time test performance and high environment requirements. This paper proposes a piezoelectrically excited ZnO nanowire (NW) mass sensor with closed-loop detection at room temperature to break this limitation. It is detected that the designed piezo-excited ZnO NW could operate at room temperature with a resonant frequency of 417.35 MHz, a quality factor of 3010, a mass sensitivity of −8.1 Hz/zg, and a resolution of 192 zg. The multi-field coupling dynamic model of ZnO NW mass sensor under piezoelectric excitation was established and solved. The nonlinear amplitude-frequency characteristic formula, frequency formula, modal function, sensitivity curve, and linear operating interval were obtained. The ZnO NW mass sensor was fabricated by a top-down method and its response to ethanol gas molecules was tested at room temperature. Experiments show that the sensor has high sensitivity, good closed-loop tracking performance, and high linearity, which provides great potential for the detection of biochemical reaction process of biological particles based on mechanics.