We study the effect of the nonmagnetic 3d atoms on the magnetic properties of the half-metallic (HM) semi-Heusler alloys Co1-xCuxMnSb and Ni1-xCuxMnSb (0 <= x <= 1) using first-principles calculations. We determine the magnetic phase diagram of both systems at zero temperature and obtain a phase transition from a ferromagnetic to an antiferromagnetic state. For low Cu concentrations the ferromagnetic Ruderman-Kittel-Kasuya-Yosida (RKKY)-type exchange mechanism dominates, while the antiferromagnetic superexchange coupling becomes important for larger Cu content. A strong dependence of the magnetism in both systems on the position of the Fermi level within the HM gap is found. Obtained results are in good agreement with the available experimental data.