The separation of rare earth elements from the mining waste water is highly important but still facing challenge. In this study, three different porous composite electrode materials were well-designed by decorating the nickel‑iron bimetallic oxide, nitride or phosphide onto nitrogen-doped carbon nanosphere, respectively (termed as NiFeO@NC, NiFeN@NC and NiFeP@NC), and utilized in capacitive deionization device for electrosorption of Yb(III) from water under the low-voltage electric field. The characterization and electrochemical results indicated that the incorporation of N or P atom lead to the reduced specific surface area and the enhanced electrochemical properties (i.e., larger specific capacitance, lower charge transfer resistance). In addition, NiFeN@NC and NiFeP@NC exhibited the excellent electrosorption capacities of Yb(III) with 105.24 mg·g−1 and 90.31 mg·g−1, respectively, under conditions of a flow rate of 20 mL·min−1, a voltage of 1.2 V, and pH of 5.0, which was extremely higher than NiFeO@NC (i.e., 50.7 mg·g−1). Moreover, all these three materials also demonstrated the remarkable electrosorption selectivity of Yb(III) from the mixed solution, and the robust durability with over 90 % of initial capacities after ten consecutive electrosorption-desorption cycles. Furthermore, the XPS characterizations and electrosorption results revealed that the electrosorption mechanism mainly depended on the synergistic effects of intrinsic Faraday redox reaction, electric double layer capacitance and active binding sites. Therefore, this work provided a feasible strategy for the separation of rare earth elements from aqueous solution, and the prospective applications related to the recovery of rare earth elements from mining wastes or spent permanent magnets in future life.