  Controlling the coherence between light and matter has enabled the radiation
of electromagnetic waves with spectral purity and stability that defines the
Syst\`eme International (SI) second. While transitions between hyperfine levels
in atoms are accessible in the microwave and optical domains, faithfully
transferring such stability to other frequency ranges of interest is not
trivial. Such stability is specifically sought after for the terahertz domain
to improve the resolution in very long baseline interferometry and molecular
spectroscopy, and advance the technological development of high-speed, high
data rate wireless communications. However, there is an evident lack of native
frequency references in this spectral range, essential for the consistency of
measurements and traceability. To mitigate the frequency drift encompassed in
such waves, we experimentally demonstrate that using rotational spectroscopy of
nitrous oxide N2O can lead to linewidth reduction up to a thousandfold. A pair
of diode lasers, optically injected with a low-noise, chip-based dissipative
Kerr soliton, were incident upon a uni-travelling-carrier photodiode. We
frequency-locked the emitted terahertz wave to the center of a rotational
transition of N2O through phase modulation spectroscopy. A terahertz wave with
a 6 Hz linewidth was achieved (fractional frequency stability of $2 \times
10^{-11}$ at 1 second averaging time) while circumventing the need of frequency
multiplication or division of frequency standards.
