The Red Devils had to come from behind after Smith Rowe put the Gunners ahead in the 13th minute with goalkeeper David de Gea floored after a collision with a teammate.
The goal stood despite United protestations, before Bruno Fernandes levelled in the 44th minute, with Ronaldo putting them ahead after the break.
Martin Odegaard squared it up in the 54th minute, before United won a penalty which Ronaldo converted for the winner.
After the game, interim United boss Michael Carrick praised Ronaldo and revealed he would be leaving the club after his brief spell in charge with Ralf Rangnick set to take over.
“When youre here youve got to dedicate everything and my life has revolved around this place for so long,” Carrick said.
“I did promise my family when I finished playing wed have some time to spend together and that never happened because I jumped into the coaching role.
“As things pan out, things happen for a reason and it felt natural to make that decision.”
On Ronaldo, he added: “To score so many goals, it’s incredible. He’s been terrific this week, especially for me, the things I’ve asked of him and the way he’s gone about his business around the players. He’s been absolutely top, top drawer. So it’s no surprise he scores again tonight, it’s the perfect ending really.”
The result puts United up to seventh while Arsenal are fifth, sandwiched by Tottenham who won 2-0 over Brentford on Thursday.
Son Heung-Min whipped in the cross for Sergi Canos’ 12th minute own goal, before netting one of his own in the second half.
