The anisotropic magnetoresistance (AMR) of ferromagnetic Mn$_5$Ge$_3$C$_x$ (0 $\le$ x $\le$ 1) and Mn$_5$Si$_3$C$_x$ (0.5 $\le$ x $\le$ 1) thin films was investigated and compared with density functional theory calculations from which the spin-split electronic density of states at the Fermi level and the spin polarization were obtained. The isostructural compounds exhibit different AMR behavior. While only Mn5Si3C0.5 shows a positive AMR ratio and a positive spin polarization, the negative AMR ratio of all other compounds is due to a negative spin polarization. The
correlation between the sign of the AMR and the degree of spin polarization is in agreement with theoretical calculations of the AMR ratio indicating that the magnetoelectronic transport in both compounds is dominated by minority-spin conduction. The dominating role of minority-spin conduction remains unaffected even after incorporation of carbon into the crystalline lattice which weakens both AMR and spin polarization.