We establish robust diagnostics for identifying Ellerman bombs (EBs) using Near-Ultraviolet (NUV) spectra from the Interface Region Imaging Spectrograph (IRIS). The primary diagnostic signature is the enhancement of the wings of the subordinate Mg II triplet lines located between the Mg II h&k lines. Non-LTE inversions of these NUV spectra reveal that EB signatures are produced by a localized temperature increase of approximately 1650 K occurring around an optical depth of $\log(\tau) \approx -3.8$ (lower solar atmosphere). A high correlation is found between triplet wing intensities and lower atmospheric temperature stratification, providing a highly reliable proxy for determining EB thermodynamics and formation depth without transition region or coronal involvement.