The ferrimagnet Mn4N forms a family of compounds useful in spintronics. In a compound comprising non-magnetic and magnetic elements, one basically expects the compound to become ferromagnetic when the proportion of the magnetic element increases. Conversely, one does not expect ferromagnetism when the proportion of the non-magnetic element increases. Surprisingly, Mn4N becomes ferromagnetic at room temperature when the Mn content is decreased by the addition of In atoms, a non-magnetic element. X-ray magnetic circular dichroism measurement reveals that the magnetic moment of Mn atoms at face-centered sites, Mn(II), reverses between x= 0.15 and 0.27 and aligns parallel to that of Mn atoms at corner sites, Mn(I), at x = 0.27 and 0.41. The sign of the anomalous Hall resistivity also changes between x = 0.15 and 0.27 in accordance with the reversal of the magnetic moment of the Mn(II) atoms. These results can be interpreted using first-principles calculations, showing that the magnetic moment of Mn(II) sites which are the nearest neighbors to the In atom align to that of Mn(I) sites.