The production of dileptons with an invariant mass in the range 1 GeV < M < 5 GeV provides unique insight into the approach to thermal equilibrium in ultrarelativistic nucleus-nucleus collisions. In this mass range, they are produced through the annihilation of quark-antiquark pairs in the early stages of the collision. They are sensitive to the anisotropy of the quark momentum distribution, and also to the quark abundance, which is expected to be underpopulated relative to thermal equilibrium. We take into account both effects based on recent theoretical developments in QCD kinetic theory, and study how the dilepton mass spectrum depends on the shear viscosity to entropy ratio that controls the equilibration time. We evaluate the background from the Drell-Yan process and argue that future detector developments can suppress the additional background from semileptonic decays of heavy flavors.