Magnesium can do a redox reaction with $\ce{Cu^2+}$ as well as with $\ce{Zn^2+}$, since Mg has the lowest reduction potential $E_0$. (I am aware that a reaction may or may not be feasible as redox, and this is according the reduction potential of the two half-equations)
\begin{array}{l|l|r} \ce{Cu^2+ & Cu} &\pu{0.34 V} \\ \ce{Zn^2+ & Zn} &\pu{-0.76 V} \\ \ce{Mg^2+ & Mg} &\pu{-2.37V} \\ \end{array}
I'm supposing we have in one beaker, a solution of $\ce{Cu^2+}$ ions and $\ce{Zn^2+}$ ions and a piece of magnesium. So the possible reactants are: $\ce{Cu^2+}$, $\ce{Zn^2+}$, and $\ce{Mg}$.
The potential difference between $\ce{Mg}$ and $\ce{Cu^2+}$ is greater than with $\ce{Zn^2+}$. So what's the answer?
My guess is "with $\ce{Zn^2+}$", since by comparing with another example, ethanol ($\ce{CH3CH2OH}$) reduces $\ce{MnO4-}$ to give $\ce{CH3CHO}$ instead of $\ce{CH3COOH}$, if the quantity of $\ce{MnO4-}$ was limited. \begin{array}{l|l|r} \ce{MnO4- & Mn^2+} & \pu{1.51 V} \\ \ce{CH3CHO & CH3CH2OH} & \pu{0.19 V} \\ \ce{CH3COOH & CH3CH2OH}& \pu{0.05 V} \end{array}
So $\ce{CH3CH2OH}$ reacted with $\ce{MnO4-}$ to give $\ce{CH3CHO}$, that leads me to deduce that in the case of multiple possibilities (i.e. feasible redox reactions), the reaction with the least potential difference takes place (since $1.51 − 0.19 < 1.51 − 0.05$).
From another hand, I guess it's familiar that the other option of having $\ce{Mn^2+}$ reacting with $\ce{Mg}$ is true as being held between the most oxidant which is $\ce{Mn^2+}$ and the most reductant which is solely $\ce{Mg}$ in our case.