Graphene has attracted a lot of attention due to its excellent electrical properties, however, the gapless nature of graphene limits its further applications. Doping is an effective way to open the bandgap, in which nitrogen-doped (N-doped) graphene has potential applications, but the study of its tribological properties is still lacking. In this work, the effects of nitrogen doping on the tribological properties of graphene under different interfacial structures are investigated by molecular dynamics simulation. The simulation models include a hexagonal graphene sheet, graphene or N-doped graphene substrate. The results show that the nitrogen doping has different effects on friction when interface structure is in a commensurate state and an incommensurate state. In a commensurate state, N-doping reduces the friction between interfaces in all cases, but the friction first goes up and then decreases with the increase of doping ratio of nitrogen. The local maximum value of friction occurs at a doping ratio of 7.5%. This phenomenon results from the interface structure and the change of van de Waals force between interfaces. The introduction of nitrogen atoms causes the lattice of graphene to distort, which results in the formation of local incommensurate state, thus reducing the interfacial potential barrier and friction. However, the van der Waals force between nitrogen atom and carbon atom between layers is stronger than that between carbon atoms and carbon atoms, which causes the friction to increase. When the doping ratio is low or high, lattice distortion plays more important role. The friction of N-doped graphene shows much smaller increase with load than that of ideal graphene, which indicates that the N-doped graphene possesses a better performance under high load. When the interface structure is in an incommensurate state, the introduction of nitrogen atoms shows slight influence on lattice mismatch, therefore, the change of atomic type plays a dominant role in determining the friction between interfaces, which goes up with the increase of N-doping ratio. When the substrate is graphene with vacancy defects, the value of friction between interfaces is larger than the ideal graphene substrate or N-doped graphene substrate, which indicates that the doping of nitrogen atoms has positive effect on reducing the friction of graphene with defects.