The more reactive metal will be oxidised so in this case it will be Magnesium.
If you refer to your standard reduction potentials sheet with the list of equations the higher the element/compound is on the table, the more likely it is to be oxidised. Since magnesium is higher on the table...