We demonstrate that single-pass Kelvin force microscopy (KFM) and dC/dz measurements in different environments expand the compositional imaging with atomic force microscopy. The KFM and dC/dz studies were performed in the intermittent contact mode with force gradient detection of tip-sample electrostatic interactions. Both factors contribute to sensitive measurements of the surface potential and capacitance gradient with nanometer-scale spatial resolution as it was verified on a broad range of materials: metal alloys, polymers, organic layers, and liquid-like objects. For many samples the surface potential and dC/dz variations complement each other in identification of individual components of heterogeneous materials. In situ imaging in different humidity or vapors of various organic solvents further facilitate recognition of the constituents of multicomponent polymer samples due to selective swelling of components.