We study scanning tunneling microscope (STM) measurements of DNA molecules. It is found that the counterions along the DNA induce an attractive potential that modifies the nature of the tunneling current such that contrast inversion emerges in the STM images. By analyzing the current-distance (I-z) dependence, we demonstrate theoretically that the DNA image contrast with respect to the substrate can be reversed by changing the current setting I-set or the bias voltage setting V-set. These findings are consistent with our experimental observations of current and bias voltage dependent contrast changes in direct STM measurements.