Need advice to control intensity in electromagnet for ferrofluid sculpture

Yes, the IRF520 is not logic-level, not suitable for driving from 5V. You're alternative is logic-level (and much lower on
resistance - the 520 is a truly ancient device I believe).