Concept:
Metals above hydrogen in the reactivity series react with dilute acids to produce hydrogen gas. Metals below hydrogen do not displace hydrogen from acids.
Explanation:
Copper and silver are below hydrogen → Do not evolve H$_2$.
Zinc, iron, magnesium, and aluminium are above hydrogen → Evolve H$_2$.
Only the pair where both metals react is magnesium and aluminium.
Conclusion:
Magnesium and aluminium react with dilute HCl and evolve hydrogen gas.