In order to enrich the potential of diluted semiconductor in low-dimensional spintronic devices, we implement a theoretical study of the magnetic properties of TM-substituted g-GaN. The results show that there is a change in the bond length and g-GaN nanosheet shows certain ionic properties after TM atoms doping. Notable electrons transfer takes place from TM atoms to g-GaN owing to the hybridization between the 3d or 4d states of TM atoms and the 2p states of N atoms near the Fermi energy level. Cr-, Ni-, Mo-, and Pd-substituted systems exhibit a certain degree of magnetism owing to fact that the nonbonding or antibonding states are not occupied completely. The magnetic moments are all originated from the polarization of TM 3d or 4d electrons and N 2p electrons.