The inner regions of the discs of high-mass young stellar objects (HMYSOs) are still poorly known due to the small angular scales and the high visual extinction involved. We deploy near-infrared (NIR) spectro-interferometry to probe the inner gaseous disc in HMYSOs and investigate the origin and physical characteristics of the CO bandhead emission (2.3-2.4 $mu$m). We present the first GRAVITY/VLTI observations at high spectral (R=4000) and spatial (mas) resolution of the CO overtone transitions in NGC 2024 IRS2. The continuum emission is resolved in all baselines and is slightly asymmetric, displaying small closure phases ($leq$8$^{circ}$). Our best ellipsoid model provides a disc inclination of 34$^{circ}$$pm$1$^{circ}$, a disc major axis position angle of 166$^{circ}$$pm$1$^{circ}$, and a disc diameter of 3.99$pm$0.09 mas (or 1.69$pm$0.04 au, at a distance of 423 pc). The small closure phase signals in the continuum are modelled with a skewed rim, originating from a pure inclination effect. For the first time, our observations spatially and spectrally resolve the first four CO bandheads. Changes in visibility, as well as differential and closure phases across the bandheads are detected. Both the size and geometry of the CO-emitting region are determined by fitting a bidimensional Gaussian to the continuum-compensated CO bandhead visibilities. The CO-emitting region has a diameter of 2.74$pm^{0.08}_{0.07}$ mas (1.16$pm$0.03 au), and is located in the inner gaseous disc, well within the dusty rim, with inclination and $PA$ matching the dusty disc geometry, which indicates that both dusty and gaseous discs are coplanar. Physical and dynamical gas conditions are inferred by modelling the CO spectrum. Finally, we derive a direct measurement of the stellar mass of $M_*sim$14.7$^{+2}_{-3.6}$ M$_{odot}$ by combining our interferometric and spectral modelling results.