Although p-type activation of GaN by Mg underpins a mature commercial technology, the nature of the Mg acceptor in GaN is still controversial. Here, we use implanted Eu as a ‘spectator ion’ to probe the lattice location of Mg in doubly doped GaN(Mg):Eu. Photoluminescence spectroscopy of this material exemplifies hysteretic photochromic switching (HPS) between two configurations, Eu0 and Eu1(Mg), of the same Eu-Mg defect, with a hyperbolic time dependence on ‘switchdown’ from Eu0 to Eu1(Mg). The sample temperature and the incident light intensity at 355 nm tune the characteristic switching time over several orders of magnitude, from less than a second at 12.5 K, ~100 mW/cm2 to (an estimated) several hours at 50 K, 1 mW/cm2. Linking the distinct Eu-Mg defect configurations with the shallow transient and deep ground states of the Mg acceptor in the Lany-Zunger model, we determine the energy barrier between the states to be 27.7(4) meV, in good agreement with the predictions of theory. The experimental results further suggest that at low temperatures holes in deep ground states are localized on N atoms axially bonded to Mg acceptors.