  The residuals of the distance moduli of Type Ia supernovae (SN Ia) relative
to a Hubble diagram fit contain information about the inhomogeneity of the
universe, due to weak lensing magnification by foreground matter. By
correlating the residuals of the Dark Energy Survey Year 5 SN Ia sample
(DES-SN5YR) with extra-galactic foregrounds from the DES Y3 Gold catalog, we
detect the presence of lensing at $6.0 \sigma$ significance. This is the first
detection with a significance level above $5\sigma$. Constraints on the
effective mass-to-light ratios and radial profiles of dark-matter haloes
surrounding individual galaxies are also obtained. We show that the scatter of
SNe Ia around the Hubble diagram is reduced by modifying the standardisation of
the distance moduli to include an easily calculable de-lensing (i.e.,
environmental) term. We use the de-lensed distance moduli to recompute
cosmological parameters derived from SN Ia, finding in Flat $w$CDM a difference
of $\Delta \Omega_{\rm M} = +0.036$ and $\Delta w = -0.056$ compared to the
unmodified distance moduli, a change of $\sim 0.3\sigma$. We argue that our
modelling of SN Ia lensing will lower systematics on future surveys with higher
statistical power. We use the observed dispersion of lensing in DES-SN5YR to
constrain $\sigma_8$, but caution that the fit is sensitive to uncertainties at
small scales. Nevertheless, our detection of SN Ia lensing opens a new pathway
to study matter inhomogeneity that complements galaxy-galaxy lensing surveys
and has unrelated systematics.
