The noninvasive, in situ chemical identification of liquid mixtures confined in porous materials is experimentally challenging. NMR is chemically resolved and applicable to optically opaque systems but suffers from a significant loss in spectral resolution in the presence of the magnetic field inhomogeneities typical of porous media. In this work, we introduce a method of analysis of conventional two-dimensional (2D) 1H NMR correlation spectroscopy (COSY) spectra based on the extraction of 1D antidiagonal projections, which are free from line-broadening effects and can therefore be used for chemical species identification. Here, we show the application of the technique to the measurement of linear n-alkanes where the cross-to-diagonal peak ratios are shown to follow a power-law curve as a function of the chain length. This calibration enables quantifying mixtures of linear hydrocarbons confined in any porous material independently of temperature or inter-molecular dynamics. Thus, this is a promising tool for quantitative chemical reaction monitoring studies in heterogeneous systems under operando experimental conditions.