Magnetism of pure electrons is fundamental for understanding diverse magnetic phenomena in condensed matters but has not been fully investigated in experiments due to the lack of a tractable model system. Such an exotic material necessitates an exclusive magnetic interaction of electrons being devoid of orbital and lattice degrees of freedom. Here, we report the two-dimensional mixed-cation [YGdC](2+)center dot 2e(-) electride, showing ferrimagnetic nature from the direct exchange interaction of magnetic interstitial electrons in interlayer space. We identify that magnetic interstitial electrons are periodically localized in octahedral and tetrahedral cavities between 2D cationic Y2-xGdx arrays. The mixed configuration of non-magnetic and magnetic cations in cavities induces divergent spin states and interactions of magnetic interstitial electrons, in which their direct exchange interaction overwhelms the interactions with magnetic cations, triggering the ferrimagnetic spin-alignment. This discovery facilitates further exploration of magnetic electrides and nurtures the study of two-dimensional magnetism of layered crystals and electron phases.