Scanning tunneling spectroscopy has recently discovered a positive correlation between the magnitude of the superconducting gap and positions of dopant oxygen atoms in Bi-based cuprates. We propose a microscopic mechanism that could be responsible for this effect. In particular, we demonstrate that the dopant-induced spatial variation of the atomic levels always enhances the superexchange interaction.