The optoelectronic properties of nanoscale systems such as carbon nanotubes (CNTs), graphene nanoribbons and transition metal dichalcogenides (TMDCs) are determined by their dielectric function. This complex, frequency dependent function is affected by excitonic resonances, charge transfer effects, doping, sample stress and strain, and surface roughness. Knowledge of the dielectric function grants access to a material’s transmissive and absorptive characteristics. Here we use the dual scanning near field optical microscope (dual s-SNOM) for imaging local dielectric variations and extracting dielectric function values using a pre-established mathematical inversion method. To demonstrate our approach, we studied a monolayer of WS2 on bulk Au and identified two areas with differing levels of charge transfer. The experiments highlight a further advantage of the technique: the dielectric function of contaminated samples can be measured, as dirty areas can be easily identified and excluded for the calculation, being important especially for exfoliated 2D materials (Rodriguez et al., 2021). Our measurements are corroborated by atomic force microscopy (AFM), Kelvin force probe microscopy (KPFM), photoluminescence (PL) intensity mapping, and tip enhanced photoluminescence (TEPL). We extracted local dielectric variations from s-SNOM images and confirmed the reliability of the obtained values with spectroscopic imaging ellipsometry (SIE) measurements.