A future widespread application of electrochemical energy conversion and storage technologies strongly depends on the substitution of precious metal-based electrocatalysts for the high-overpotential oxygen reduction and oxygen evolution reactions. We report a novel Co/Co–Fe nanoparticles/N-doped carbon composite electrocatalyst (Co/CoxFey/NC) obtained by pyrolysis of CoFe layered double hydroxide (CoFe LDH) embedded in a film of a bisphenol A and tetraethylenepentamine-based polybenzoxazine poly(BA-tepa). During pyrolysis poly(BA-tepa) forms a highly conductive nitrogen-doped carbon matrix encapsulating Co/Co–Fe nanoparticles, thereby circumventing the need of any additional binder material and conductive additives. Optimization with respect to pyrolysis temperature, the CoFe LDH/BA-tepa ratio, as well as of the gas atmosphere used during the thermal treatment was performed. The optimized Co/CoxFey/NC composite material catalyst exhibits remarkable bifunctional activity towards oxygen reduction (ORR) and oxygen evolution (OER) reactions in 0.1 M KOH represented by a potential difference of only 0.77 V between the potentials at which current densities of −1 mA cm−2 for the ORR and 10 mA cm−2 for the OER were recorded. Moreover, the Co/CoxFey/NC composite material pyrolyzed in ammonia atmosphere exhibits promising stability during both the ORR and the OER.