Manucho twice put the hosts ahead from corners, but Madrid equalised through first Karim Benzema and then, on the stroke of half-time, Ozil.
The German then curled home a sublime second-half free-kick, his fifth goal in seven games, to seal the points.
Cristiano Ronaldo fired over from long range in the second minute, but it was Valladolid who took an early lead.
Patrick Ebert's seventh-minute corner was not cleared and, when the ball was turned back across goal, Manucho was on hand to fire home from two yards.
But Madrid were gifted an equaliser when Mikel Balenziaga's underhit pass and Marc Valiente's slip presented the ball to Jose Callejon, who set up Benzema for a tap-in.
But another Ebert corner saw Manucho rise unchallenged at the near post to head his and Valladolid's second and restore the hosts' lead.
Callejon wasted a chance for an immediate leveller on that occasion when he mis-hit a lob wide off his shin and Ronaldo forced a good low save from Daniel Hernandez.
Valladolid lost key man Ebert to a hamstring injury, Alberto Bueno taking his place in the 30th minute.
Valiente made a brilliant goal-saving challenge to deny Benzema his second, while Hernandez fielded the Frenchman's bouncing shot following a corner.
But Madrid equalised seconds before half-time when Ozil and Benzema linked up, the latter's backheel setting up the Germany international to finish left-footed.
Real boss Jose Mourinho sent on Angel Di Maria at half-time in place of Nacho Fernandez, with Callejon dropping in at left-back.
Sergio Ramos headed Xabi Alonso's free-kick wide, but Oscar Gonzalez twice went close for Valladolid, including an effort which Iker Casillas fumbled around the post.
Mourinho made another bold attacking substitution just after the hour, replacing Alvaro Arbeloa with Luka Modric and dropping Alonso in at centre-back.
Ramos had a goal disallowed despite springing from an onside position, though at least some of the four Madrid players in offside positions were surely active.
But the visitors were soon ahead for the first time as Henrique Sereno fouled Benzema and Ozil curled in the resulting free-kick via the underside of the crossbar.
Mourinho immediately took steps to rebalance his increasingly lop-sided XI as he replaced Benzema with another Frenchman, defender Raphael Varane.
Manucho was surprisingly withdrawn 13 minutes from time, Javi Guerra taking his place.
Hernandez made a superb reaction save from Ramos' header and easily fielded Ronaldo's shot, but Bueno's low shot at the other end was easy for Casillas as Madrid held on.