Scanning probe microscopy is one of the most versatile windows into the nanoworld, providing imaging access to a variety of sample properties, depending on the probe employed. Tunneling probes map electronic properties of samples, magnetic and photonic probes image their magnetic and dielectric structure while sharp tips probe mechanical properties like surface topography, friction or stiffness. Most of these observables, however, are accessible only under limited circumstances. For instance, electronic properties are measurable only on conducting samples while atomic-resolution force microscopy requires careful preparation of samples in ultrahigh vacuum or liquid environments. Here we demonstrate a scanning probe imaging method that extends the range of accessible quantities to label-free imaging of chemical species operating on arbitrary samples - including insulating materials - under ambient conditions. Moreover, it provides three-dimensional depth information, thus revealing subsurface features. We achieve these results by recording nuclear magnetic resonance signals from a sample surface with a recently introduced scanning probe, a single nitrogen-vacancy center in diamond. We demonstrate NMR imaging with 10 nm resolution and achieve chemically specific contrast by separating fluorine from hydrogen rich regions. Our result opens the door to scanning probe imaging of the chemical composition and atomic structure of arbitrary samples. A method with these abilities will find widespread application in material science even on biological specimens down to the level of single macromolecules.