Optical-based terahertz sources are important for many burgeoning scientific and technological applications. Among such applications is precision spectroscopy of molecules, which exhibit rotational transitions at terahertz frequencies. Stemming from precision spectroscopy is frequency discrimination (a core technology in atomic clocks) and stabilization of terahertz sources. Because many molecular species exist in the gas phase at room temperature, their transitions are prime candidates for practical terahertz frequency references. We demonstrate the stabilization of a low phase-noise, dual-wavelength Brillouin laser (DWBL) terahertz oscillator to a rotational transition of carbonyl sulfide (OCS). We achieve an instability of