Los Blancos enjoyed most of the possession but they had to wait until the 19th minute for their first chance when Marcelo forced Sergio Asenjo into a fine save.
Four minutes later, Cristiano Ronaldo went close to giving Real the lead when his free-kick from distance hit the top of the crossbar.
It was one-way traffic in the first and Ronaldo went close again after 31 minutes when his attempted lob sailed just wide of the upright.
Villarreal, meanwhile, found it tough to get out of their own half which led to a lack of chances for the visiting side.
The visitors did go close five minutes into the second half as Denis Cheryshev created some space for himself before firing just wide of the upright.
The Yellow Submarine went close again after the hour mark when Samu Castillejo played in Carlos Bacca, who could only fire into the side-netting.
Real were finding it tough to break down the Villarreal defence and introduced Marco Asensio and Lucas Vazquez for the final 20 minutes.
However, it was the visitors who broke the deadlock with three minutes remaining when Navas pushed Cheryshev's effort into the path of Pablo Fornals, who made no mistake from close range.
Villarreal managed to see off a late surge from the defending champions to claim a famous victory.