The exploiting of bifunctional transition metal electrocatalysts for the oxygen reduction reaction (ORR) and the oxygen evolution reaction (OER) is of significance for the commercialization of rechargeable zinc-air batteries (ZABs). Herein, the N and S atoms-doped hierarchical carbon framework hosting the Co3Fe7/Fe0.8Co0.2S heterojunction is synthesized by employing porous g-C3N4 as framework and spacer, and FeCo-ZIF as metal source followed by sulfidation and pyrolysis. The detailed characterization confirms that the porous g-C3N4 plays a crucial role in improving the dispersion of metal nanoparticles. The obtained FeCo-Sx@NSC-900 catalysts exhibit layered accumulation configuration with uniformly distributed metal nanoparticles. Moreover, the typical carbon@metal nanoparticles and heterojunction structure can be observed from the HRTEM (High-Resolution Transmission Electron Microscopy) and HAADF-STEM (high-angle annular dark-field STEM) analysis results. The optimal FeCo-Sx@NSC-900 catalysts deliver exceptional ORR and OER performance with a potential difference between ORR and OER of merely 0.713 V, which is superior to the commercial Pt/C+RuO2 catalysts and other monometallic catalysts. Additionally, the ZAB assembled with the optimal FeCo-Sx@NSC-900 catalysts as cathode affords a good battery performance with high OCV (1.50 V), large power density (172 mW/cm2), good discharge stability, large specific capacity, and long-term charge/discharge stability (>300 cycles).