The Croat opened the scoring with a fine strike just after the half-hour mark before the Portuguese racked up his 10th Liga goal in just four games
The Portugal international went into the fixture having scored nine goals in just four La Liga matches this season and unsurprisingly took his tally to 10 as Los Blancos were made to fight at El Madrigal.
Villarreal looked the better side for significant periods of the game and made Iker Casillas work on a number of occasions in the first half.
A 'come home Ronaldo' banner, commissioned by a group of Manchester United fans, flew over the ground as the Ballon d'Or winner endured a quiet start to the game.
However, Luka Modric put Madrid ahead with a stylish finish just after the half-hour mark and Ronaldo finally came to life in the lead up to half time, slotting home from Karim Benzema's pinpoint pass in the 40th minute.
Villarreal continued to look extremely lively going forward in the second period, but proceeded to waste more chances and Carlo Ancelotti's side were able to earn a hard-fought victory.
Coach Marcelino Garcia Toral was adamant that Villarreal would be highly motivated against Real and they looked particularly fired up during the early stages, giving their visitors a tough start.
Casillas was first called into action after just seven minutes as he palmed an Ikechukwu Uche effort around the post, and Luciano Vietto shot into the side-netting soon after.
Attention turned to the sky in the 16th minute as the 'come home Ronaldo' banner was flown over the ground.
It failed to spark an immediate reaction from the Portugal star, though, with Uche and Mario both going close for the hosts, who remained the more threatening.
Despite Villarreal's apparent superiority, Real opened up a 2-0 lead before the break.
Modric fired in a fine drive from 20 yards with 32 minutes on the clock and the second arrived soon after as Ronaldo confidently buried Benzema's well-placed cut-back.
Villarreal ensured a tense end to the first half for Madrid, though, as Casillas denied Vietto from point-blank range and Marcelo produced an incredible last-ditch block to keep Manu Trigueros' effort out.
Luckily for Ancelotti's men, the hosts were no less wasteful early in the second half.
Gabriel Paulista fired well over in the 48th minute after finding himself behind the Madrid defence.
The presence of 20-year-old Vietto proved troubling for Los Blancos and he almost slid in to pull one back for Villarreal in the 58th minute, but the Argentine could not quite reach Moi Gomez's teasing cross.
Marcelino could have no complaints about his team's persistent effort, as Jonathan Dos Santos tested Casillas with an audacious half-volley from 30 yards.
However, Madrid – who threatened exclusively on the counter late on – held on for a battling triumph, aiding their bid to play catch-up on those tussling at the summit of the table.