The influence of Co and Cu doping on Ni-Mn-Ga Heusler alloy is investigated using the first-principles exact muffin-tin orbital method in combination with the coherent-potential approximation. Single-element doping and simultaneous doping by both elements are investigated in Ni${}_{50\ensuremath{-}x}$Co${}_{x}$Mn${}_{25\ensuremath{-}y}$Ga${}_{25\ensuremath{-}z}$Cu${}_{y+z}$ alloys, with dopant concentrations $x,\phantom{\rule{0.28em}{0ex}}y$, and $z$ up to 7.5 at. %. Doping with Co in the Ni sublattice decreases the ${(c/a)}_{\text{NM}}$ ratio of the nonmodulated (NM) martensite, but it simultaneously increases the cubic phase stability with respect to the NM phase. Doping with Cu in the Mn or in Ga sublattices does not change the ${(c/a)}_{\text{NM}}$ ratio significantly and it decreases the cubic phase stability. For simultaneous doping by Co in the Ni sublattice and Cu in the Mn or Ga sublattices, the effects of the individual dopants are independent and about the same as for the single-element doping. Thus, the ${(c/a)}_{\text{NM}}$ ratio can be adjusted by Co doping while the phase stability can be balanced by Cu doping, resulting in stable martensite with a reduced ${(c/a)}_{\text{NM}}$. The local stability of the cubic phase with respect to the tetragonal deformation can be understood on the basis of a density-of-states analysis.