Using first principles calculations, we demonstrate an effective method to tailor the local spin configuration of graphene on Co(0001) surface through nitrogen doping. Two different site occupancies of the N impurities are discussed with the focus on structural, electronic and magnetic properties. N induces opposite local spin polarization at the two sites through π−d Zener exchange-type hybridization with Co substrate. In addition, the induced spin polarization is energy dependent and controllable by electric field. Consequently, this structure can be applied as a spin injection source in graphene based spintronics.