Variations in the strength of the piezoelectric field inside InGaN quantum wells have been observed along the growth direction in InGaN-based diodes emitting light in the green region. The internal electrostatic potential distribution across the active region consisting of five InGaN quantum wells has been determined by electron holography in a transmission electron microscope. The strength of the piezoelectric field decreases in the direction towards the p-n junction. Its effect on light emission has been evaluated by depth-profiling cathodoluminescence, where the emission from two peaks becomes increasingly distinct with increasing excitation voltage. The drop in piezoelectric field strength is proposed to be related to the neutralization of piezoelectric charges by hydrogen ions which are initially abundant in the p region and diffuse into the quantum wells during thermal annealing.