In this study, based on density functional theory calculations, we investigated the stable configurations, electronic structures, and magnetic properties of metal and non-metal atom-modified graphene substrates. The single-atom metal embedded divacancy (555–777) graphene (555-777-graphene-M, M = Fe, Ni and Pd) exhibited high stability, and the 555-777-graphene-Fe system had a larger magnetic moment than the Ni-doped system. The adsorption of NO on 555-777-graphene-Fe (or -Ni) was more stable than that of the HCN, NH3 and SO2 molecules. Among the other substrates, the NO adsorbed on 555-777-graphene-Fe system had the largest magnetic moment (3.0 μB). The metal atoms anchored on 3Si doped 555–777 graphene (3Si-graphene-M) had larger adsorption energies than the corresponding cohesive energy values for the bulk metal. The gas molecules adsorbed on 3Si-graphene-M sheets were more stable than those on 555-777-graphene-M. NO can be detected easily as a specific gas molecule because it has the largest adsorption energy. The NH3 or NO adsorbed on different 3Si-graphene-M substrates could lose or gain less transferred electrons and they exhibited moderate stability, thereby indicating that they are more sensitive than other gases and can be detected easily. Moreover, the electronic structures and magnetic properties of 3NM-graphene-M sheets were regulated by selecting different gas molecules, thereby facilitating the design of novel graphene-based spintronic or gas sensor devices.