Improving p-type doping efficiency in Al-rich AlGaN alloys is a worldwide problem for the realization of AlGaN-based deep ultraviolet optoelectronic devices. In order to solve this problem, we calculate Mg acceptor activation energy and investigate its relationship with Mg local structure in nanoscale (AlN)5/(GaN)1 superlattice (SL), a substitution for Al(0.83)Ga(0.17)N disorder alloy, using first-principles calculations. A universal picture to reduce acceptor activation energy in wide-gap semiconductors is given for the first time. By reducing the volume of the acceptor local structure slightly, its activation energy can be decreased remarkably. Our results show that Mg acceptor activation energy can be reduced significantly from 0.44 eV in Al(0.83)Ga(0.17)N disorder alloy to 0.26 eV, very close to the Mg acceptor activation energy in GaN, and a high hole concentration in the order of 10(19) cm(-3) can be obtained in (AlN)5/(GaN)1 SL by Mg(Ga) δ-doping owing to GaN-monolayer modulation. We thus open up a new way to reduce Mg acceptor activation energy and increase hole concentration in Al-rich AlGaN.