Terahertz (THz) time domain spectroscopy is used to investigate the gain and losses of a THz quantum cascade laser (QCL) operating at 2.86THz. This measurement technique allows access to the amplitude and phase spectra, allowing the direct determination of the gain. At the emission frequency of the QCL, a value of 6.5cm-1 is found. The gain can also be studied as a function of different operating conditions, even when no laser action is present. Effects such as gain clamping and spectral narrowing are also observed. Furthermore, temperature measurements illustrate the reduction of the gain as the temperature is increased.