Marco Reus had deservedly put the German champions in front on 28 minutes with a spectacular volley from Robert Lewandowski's knockdown, but Pepe levelled for the hosts six minutes later with a bullet header from Ozil's cross.
The visitors went back in front seconds before the break thanks to Mario Gotze's chip over Iker Casillas that found the net via a deflection off Alvaro Arbeloa, but Madrid were much improved after half-time and finally got level thanks to Ozil's perfectly placed free-kick.
The draw leaves Dortmund on top of the group with eight points from four games with Real in second on seven, three points clear of Ajax in third.
Dortmund had failed to win in their previous six European games away from home but started with the assurance that had seen then dominate for large spells in the 1-1 draw away at Manchester City earlier in the group.
Marcel Schmelzer had struck the winner when the sides met in Germany a fortnight ago and he was first to threaten on nine minutes, but after Casillas had parried his initial effort Lewandowski wastefully volleyed over the rebound.
Kevin Grosskreutz then also saw a effort from the edge of the area turned away by the Spanish captain before Real created their first big opportunity midway through the half.
Gonzalo Higuain broke the offside trap and crossed for Cristiano Ronaldo who was free at the far post, but his mistimed header went wide.
Dortmund were consistently causing problems in behind the Real full-backs and the opening goal arrived from that area as Neven Subotic's long ball was headed down by Lewandowski and brilliantly volleyed high past Casillas by Reus for his second Champions League goal of the campaign.
The lead only lasted six minutes though as Dortmund failed to properly clear a corner from the left and Ozil's cross was powered home at the far post by Pepe.
Watch: Ozil rescues point for Madrid... More Videos
Raphael Varane then had to make a fine saving tackle to prevent Reus breaking clear on goal again, while Schmelzer did the same to dispossess Ronaldo at the other end seconds later as the game switched from end to end and from their next attack Dortmund retook the lead right on half-time.
Again a long ball to Lewandowski caused problems as Grosskreutz raced onto his flick on and then lobbed the ball into Gotze, who calmly lifted it home over Casillas via a deflection off Arbeloa.
Real boss Jose Mourinho made two changes at half-time as Higuain, who had been struggling with a hamstring injury, and Luka Modric were replaced by Jose Maria Callejon and Michael Essien.
Callejon almost made an immediate impact as he swept the ball home from Ozil's pass but the goal was ruled out for offside.
Callejon came within inches of an equaliser again moments later with a shot that whistled past the post and was denied for a third time by Roman Weidenfeller as he tried to round the goalkeeper.
Weidenfeller then made a remarkable save with his legs to keep his side ahead as Ronaldo turned Angel Di Maria's low cross towards goal from six yards 12 minutes from time, and Dortmund were then rescued by a goal-line clearance from Grosskreutz as Callejon squeezed another effort on target inside a packed penalty box.
However, the pressure finally told as Ozil's brilliant free-kick from 20 yards crept inside Weidenfeller's left-hand post a minute from time.