Ronaldo hammered the ball into the roof of the net to send Old Trafford into pandemonium as he scored his fifth goal in as many appearances - with this being no doubt the most important.
Paco Alcacer gave Villarreal the lead shortly into the second half after toe-poking the ball past David de Gea - who had an exceptional game and kept United in it by making numerous world-class saves.
Story of the game
'Viva Ronaldo' rung out from the moment the United players stepped out onto the pitch. It was Ronaldo's first Champions League game at Old Trafford as a United player in over 12 years. It was also a night where he broke yet another record by becoming the all-time Champions League appearance holder (178).
Despite United reacting to their loud crowd and starting well, Villarreal should have gone one-nil up after Danjuma was in behind and one-on-one with De Gea. Fortunately for the Spanish goalkeeper, Danjuma fired it right at him.
Danjuma caused another problem, he cut onto his right foot and fired the ball into the far right corner - where he probably should have aimed with his first shot - and forced de Gea to make a world-class finger-tip save to turn it around the post for a corner.
De Gea was called into action once more when Danjuma let rip again from the left flank. The Dutch winger caused Dalot all sorts of problems - who was stepping in for the suspended Wan-Bissaka.
Alcacer was the next Villarreal forward who should have scored. This time, Raphael Varane was dispossessed at the back and Alcacer advanced the ball forward before dragging his shot wide.
United could probably consider themselves lucky as they went into the half-time break all square, despite Villarreal having plenty of chances. Emery will be disappointed his side couldn't capitalise when on top.
After another bright start after the interval, United found themselves a goal behind. Alcacer poked the ball past De Gea from Danjuma's cross. It was nothing short of what Villarreal deserved and Dalot will be once again disappointed as he let Danjuma breeze past and in behind.
United responded to going behind - as they so typically do - with a fantastic equalising goal. Telles, who only featured because of Luke Shaw's injury at the weekend, connected sweetly with a deep ball to the back post from Fernandes' free-kick.
It was some way to open his goalscoring account with the club, and brought back memories of the legendary Paul Scholes.
Cavani almost had an instant impact as Mason Greenwood picked him out at the far post. The Uruguayan striker had an empty net to aim at as Geronimo Rulli mistimed his jump.
Cavani squandered the chance and his free header went wide.
Villarreal had a glorious opportunity to steal three points but a goal-mouth scramble led to nothing and United cleared.
Fred, the substitute, found space on the left and launched a ball to the back post. Ronaldo won the header and Jesse Lingard's strike rebounded into the path of the Portuguese superstar to smash it home.
It's a victory that will be significant to United's chances of making it out of their group and into the knockout rounds after suffering a shock upset at Young Boys a fortnight ago.