We report the heterodyne detection and phase locking of a 2.5 THz quantum cascade laser (QCL) using a terahertz frequency comb generated in a GaAs photomixer using a femtosecond fiber laser. With 10 mW emitted by the QCL, the phase-locked signal at the intermediate frequency yields 80 dB of signal-to-noise ratio in a bandwidth of 1 Hz.