We calculate Mg-acceptor activation energy EA and investigate the influence of O-atom, occupied the Mg nearest-neighbor, on EA in nanoscale (AlN)5/(GaN)1 superlattice (SL), a substitution for Al0.83Ga0.17N disorder alloy, using first-principles calculations. We find that the N-atom bonded with Ga-atom is more easily substituted by O-atom and nMgGa-ON (n = 1-3) complexes are favorable and stable in the SL. The O-atom plays a dominant role in reducing EA. The shorter the Mg-O bond is, the smaller the EA is. The Mg-acceptor activation energy can be reduced significantly by nMgGa-ON δ-codoping. Our calculated EA for 2MgGa-ON is 0.21 eV, and can be further reduced to 0.13 eV for 3MgGa-ON, which results in a high hole concentration in the order of 1020 cm−3 at room temperature in (AlN)5/(GaN)1 SL. Our results prove that nMgGa-ON (n = 2,3) δ-codoping in AlN/GaN SL with ultrathin GaN-layer is an effective way to improve p-type doping efficiency in Al-rich AlGaN.