John McGinn and Leander Dendoncker were on target in the first half to give the visitors a two-goal cushion at the break.
United thought they had a goal back when Alejandro Garnacho finished off a brilliant team move, but it was ruled out for offside.
However, the disallowed strike put the wind in United’s sails and less than 10 minutes later Garnacho scored to end United’s goal drought of more than seven hours.
With 20 minutes to play, Garnacho struck a second time to level matters and set up an electric ending to the game.
United were firmly in control in the final stages and Hojlund found himself in the right place at the right time to smash United ahead with his first Premier League goal for the club.
Erik ten Hag’s side held on for the victory to end a run of four matches without a win.