  Jet quenching has long been regarded as one of the key signatures for the
formation of quark-gluon plasma in heavy-ion collisions. Despite significant
efforts, the separate identification of quark and gluon jet quenching has
remained as a challenge. Here we show that $J/\psi$ in high transverse momentum
($p_\text{T}$) region provides a uniquely sensitive probe of in-medium gluon
energy loss since its production at high $p_\text{T}$ is particularly dominated
by gluon fragmentation. Such gluon-dominance is first demonstrated for the
baseline of proton-proton collisions within the framework of leading power
NRQCD factorization formalism. We then use the linear Boltzmann transport model
combined with hydrodynamics for the simulation of jet-medium interaction in
nucleus-nucleus collisions. The satisfactory description of experimental data
on both nuclear modification factor $R_{\text{AA}}$ and elliptic flow $v_2$
reveals, for the first time, that the gluon jet quenching is the driving force
for high $p_\text{T}$ $J/\psi$ suppression. This novel finding is further
confirmed by the data-driven Bayesian analyses of relevant experimental
measurements, from which we also obtain the first quantitative extraction of
the gluon energy loss distribution in the quark-gluon plasma.
