Magnesium has no unpaired electrons. To be magnetic, a metal must have at least one unpaired electron (i.e., a spin up electron without a corresponding spin down electron). In general, response to a magnetic field is a property of electron spin.
Most types of Iron are magnetic, however depending on its composition and purity, there are kinds that are not magnetic. For example, Steel is mostly Iron, Carbon, and a few other lesser materials,...
The element nickel is attracted to a magnet.
Many "nickel" items contain large amounts of other metals so they're not strongly attracted however. For example, US 5ยข coins are called nickels but...