We investigate interaction effects which occur in scanning tunneling microscopy (STM) by performing local force spectroscopy with an oscillating tip while imaging Si(111)77 terraces in the dynamic lever STM mode (constant time-averaged current). It is found that true atomic resolution is achieved close to the minimum of the resonance frequency vs. distance curve and even closer to the sample. On the other hand true atomic resolution in noncontact AFM (constant frequency shift) is expected several nm away from this minimum, in the range where the frequency shift becomes more negative with decreasing distance.