Nanotechnology and modern materials science demand reliable local probing techniques on the nanoscopic length scale. Most commonly, scanning probe microscopy methods are applied in numerous variants and shades, for probing the different sample properties. Scattering scanning near-field optical microscopy (s-SNOM), in particular, is sensitive to the local optical response of a sample, by scattering light off an atomic force microscopy (AFM) tip, yielding a wavelength-independent lateral resolution in the order of ∼10 nm. However, local electric potential variations on the sample surface may severely affect the probe–sample interaction, thereby introducing artifacts into both the optical near-field signal and the AFM topography. On the other hand, Kelvin-probe force microscopy (KPFM) is capable of both probing and compensating such local electric potentials by applying a combination of ac and dc-voltages to the AFM tip. Here, we propose to combine s-SNOM with KPFM in order to compensate for undesirable electrostatic interaction, enabling the in situ probing of local electric potentials along with pristine optical responses and topography of sample surfaces. We demonstrate the suitability of this method for different types of materials, namely, metals (Au), semiconductors (Si), dielectrics (SiO2), and ferroelectrics (BaTiO3), by exploring the influence of charges in the systems as well as the capability of KPFM to compensate for the resulting electric force interactions.