Light emission from the gap cavity formed by the tip of a scanning tunneling microscope (STM) and a flat metallic sample allows us to probe the dielectric response of metals at the atomic scale and presents a way to distinguish between different materials. The excitation mechanism of the charge carrier oscillations, which ultimately decay into light, is linked to inelastic electron tunneling as opposed to the mostly semiclassical picture of the electromagnetic resonance of the gap cavity. Thus, the observed light emission does not only reflect the electromagnetic resonance of the cavity but also involves the electronic density of states. In this paper, we compare light emission from Cu(111) and Co nanoislands on Cu(111). We find a strong intensity contrast but almost no alteration of the resonance wavelength except close to step edges. Our results show that the light emission from the STM junction is highly sensitive to a few atomic layers of alien material mostly due to the dielectric properties of the layer.