Detection of trace gases, such as radioactive carbon dioxide, clumped isotopes, and reactive radicals, is of great interest and poses significant challenges in various fields. Achieving both high selectivity and high sensitivity is essential in this context. We present a highly selective molecular spectroscopy method based on comb-locked, mid-infrared, cavity-enhanced, two-photon absorption. The Doppler-free nature of two-photon transitions considerably reduces the width of the resonance, which improves the selectivity and avoids interference due to nearby transitions from other molecules. The high-finesse optical cavity increases the laser power by thousands of times and compensates for the small cross-section of the two-photon transition. The quantitative capability of the method is demonstrated by measuring 13CO2 abundances in CO2 samples. The method is promising for the quantitative measurement of extremely trace molecules or isotopologues in gas samples.