Polycrystalline ZnO thin films were deposited on pure Al foils at 80 °C using electrochemical deposition (ECD) in solutions containing zinc nitrate hexahydrate and hexamethylenetetramine. Photoluminescence (PL) spectra between 20 and 200 K showed intense UV emissions near the band edge along with weak broad bands due to defects. When the source solution was slightly doped with Mg2+ ions, the defect-induced band was suppressed along with a redshift, whereas the UV peak position and intensity remained the same. Surprisingly, Auger electron spectroscopy (AES) revealed no Mg contents in the films within the detection limit. Based on the solubility products of Mg(OH)2 and Zn(OH)2, we put forward a mechanism to describe how metal impurities could be incorporated into ZnO in such an aqueous process, which was strongly supported by samples grown in Ca- or Cu-doped solutions. To further corroborate, we also fabricated, for the first time via ECD, MgZnO alloys in Mg-doped solutions with very high nitrate concentrations. Blue shift of the UV emission peak was clearly observed from as-prepared samples on Al. MgZnO films, deposited on Si substrates under similar supersaturated conditions and annealed in ambient air at 350 °C for 30 min, showed a similar peak shift. This electrochemical route could therefore be used as an effective approach to enhance the optical properties of compound semiconductors, demonstrating its potential for deep UV applications as well.