The optical gradient force provides optomechanical interactions, for particle trapping and manipulation, as well as for near-field optical imaging in scanning probe microscopy. Based on recent spectroscopic experiments, its extension and use for a novel form of chemical scanning probe nanoimaging was proposed. Here, we provide the theoretical basis in terms of spectral behavior, resonant enhancement, and distance dependence of the optical gradient force from numerical simulations in a coupled nanoparticle model geometry. We predict an asymmetric line shape of the optical gradient force for molecular electronic or vibrational resonances, corresponding to the real part of the dielectric function of the sample materials. Yet the line shape can become symmetric and absorptive for collective polaritonic excitations. The corresponding magnitudes of the force range from fN to pN, respectively. The distance dependence scales considerably less steeply than simple point dipole model predictions due to multipole effects. The combination of these characteristics of the optical gradient force offers the chance to experimentally distinguish it from competing processes such as thermal expansion induced forces. In addition we provide a perspective for further resonant enhancement and control of optical forces.