The German international’s brace included an exquisitely-curled, left-footed winner from a free-kick on 71 minutes to keep Madrid on the tails of Barca and second-placed Atletico Madrid.
Former Manchester United striker Manucho twice gave Valladolid first-half leads that Karim Benzema and Ozil cancelled out.
Barcelona go to Real Betis on Sunday while Atletico, now only two points ahead of their city neighbours, entertain Deportivo La Coruna.
Afterwards Real coach Jose Mourinho sent out his assistant Aitor Karanka to face the press and he was full of praise for the match winner.
“Ozil was exceptional and did a lot of work off the ball as well, I think we saw the Mesut that we all want to see tonight. We changed it around at half-time in search of more width and the win and it paid off,” he said.
Earlier, Mourinho had handed Nacho Fernandez his first start of the season in the league after an impressive performance in the win over Ajax on Wednesday while Jose Callejon, who hit a double that night, was also included.
Madrid began well with Cristiano Ronaldo hitting a dipping drive just over the bar before Callejon tested Dani Hernandez in the home goal.
But on seven minutes Valladolid went ahead through Manucho in their first real attack.
When Pepe cleared a dangerous cross into the area, the resulting corner was not dealt with by the Madrid defence and the big Angolan striker was the quickest to react to hit his first of the evening.
Within five minutes Benzema had equalised, Callejon took advantage of a Mikel Balenziaga slip to advance to the byeline and pull back a pass that gave the Frenchman an easy finish.
Hernandez then had to punch clear a swerving free-kick from Ronaldo before Valladolid won another corner at the other end.
Taken on the left, the same as the opener, German winger Patrick Ebert again whipped in a vicious inswinger that was met by Manucho’s head without a challenge.
The impressive Ebert then smashed a free-kick just wide from distance before limping off with a muscle injury, a big loss for the home team.
Hernandez had to be sharp to tip wide a Ronaldo drive but Valladolid were looking better organised and more capable of holding onto their lead the second time around.
It was going to take something special to get Madrid back in the game and it came right on half-time.
Ozil, who had been quiet until that moment, headed towards the area on a mazy run and exchanged passes with Benzema, who returned a neat back flick, before the German stabbed past Hernandez for the leveller.
Mourinho cut short Nacho’s return at half-time, replacing him with Angel Di Maria, as a more attack-minded formation went in search of victory.
His side were quick out of the blocks, Sergio Ramos headed wide a Xabi Alonso free-kick before Benzema had another shot stopped by Hernandez, who later made the save of the game from a Ramos header.
The home side also contributed to what was an open and competitive game throughout.
An Oscar Gonzalez shot that forced Iker Casillas into a stop was the closest they came to winning it.
However, Ozil’s class was again the difference and his perfectly hit winner ensured the points went back to Madrid.
Valencia won 1-0 at Osasuna to kick-off new coach Ernesto Valverde’s reign with a victory.
Spain striker Roberto Soldado got the only goal on 55 minutes to move his side into the top half of the league while Osasuna remain in 16th position.
Malaga thrashed Granada 4-0 to move into fourth. Two goals in each half, and some clinical finishing, were enough in a convincing win for the Costa del Sol side.
Joaquin Sanchez got the first, before Javier Saviola, Ignacio Camacho and former Manchester City player Roque Santa Cruz added goals.
Real Sociedad and Getafe stretched their unbeaten runs to five and four matches respectively with a 1-1 draw in which two headed goals came in the last five minutes.
Angel Lafita put the visitors into the lead before Carlos Martinez grabbed a point for Sociedad in injury time.