Nitrogen-doped carbon (N–C) materials are promising low-cost catalysts for oxygen reduction reaction (ORR). However, the commonly used route for N–C synthesis, viz., the high-temperature pyrolysis of N- and C-containing precursors, usually results in a great loss of N-containing species determining the ORR catalytic performance. Herein, porous N–C materials are synthesized by using g-C3N4 embedded in glucose-derived carbon as template and N source. The N–C sample synthesized at 900 °C with a mass ratio of glucose to g-C3N4 being 4:1 exhibits a positive half-wave potential (E1/2 = 0.823 V), good long-term stability and dominant 4 e− pathway for ORR in alkaline media, which can be attributed to its large specific surface area, high porosity, and large fraction of pyridinic and graphitic N. When a small amount of Fe is doped into the N–C sample, its ORR performance can be greatly improved and outperforms the commercial Pt/C catalyst in terms of ORR activity (E1/2 = 0.880 V), long-term stability and methanol tolerance. Notably, primary Zn-air batteries with N–C and Fe–N–C being the cathode catalysts exhibit peak power densities of 88 and 100 mW cm−2, respectively. This work offers a promising route for the synthesis of porous carbon-based materials highly efficient as ORR catalyst for Zn-air battery.