  We explore how diffuse stellar light and globular clusters (GCs) can be used
to trace the matter distribution of their host halo using an observational
methodology. For this, we use 117 simulated dark matter (DM) haloes from the
$(34.4~\rm cMpc)^3$ periodic volume of the E-MOSAICS project. For each halo, we
compare the stellar surface brightness and GC projected number density maps to
the surface densities of DM and total mass. We find that the dominant
structures identified in the stellar light and in the GCs correspond closely
with those from the DM and total mass. Our method is unaffected by the presence
of satellites and its precision improves with fainter GC samples. We recover
tight relations between the profiles of stellar surface brightness and GC
number density to those of the DM, suggesting that the profile of DM can be
accurately recovered from the stars and GCs ($\sigma\leq0.5~$dex). We quantify
the projected morphology of DM, stars and GCs, and find that the stars and GCs
are more flattened than the DM. Additionally, the semi-major axes of the
distribution of stars and GCs are typically misaligned by $\sim 10~$degrees
from that of DM. We demonstrate that deep imaging of diffuse stellar light and
GCs can place constraints on the shape, profile and orientation of their host
halo. These results extend down to haloes with central galaxies
$M_{\star}\geq10^{10}~M_{\odot}$, and the analysis will be applicable to future
data from the Euclid, Roman and the Rubin observatories.

Astrophysics of Galaxies;Cosmology and Nongalactic Astrophysics