Defender Mats Hummels gave Dortmund an early lead but they were left fuming when Petar Sliskovic equalised from close range in the 89th minute with Dortmund's Neven Subotic down injured in the box with the referee allowing play to go on.
"This is a fair result in a way," said Dortmund coach Jurgen Klopp. "Mainz were a tough opponent and for us a lot went wrong today. We missed a penalty and then had to take (striker Lucas) Barrios off."
Barrios went off injured late in the first half after colliding with Mainz goalkeeper Christian Wetklo.
Franck Ribery scored an 88th minute goal to give fourth-placed Bayern Munich a nervy 2-1 win at Freiburg that keeps them in the hunt for a Champions League spot.
Ribery fired in a low left-footed drive to break the hosts' gutsy resistance and lift the champions to 48 points, two behind Hanover 96 who beat Hoffenheim 2-0.
Germany international Hummels' glancing header after eight minutes put Dortmund in the driving seat but Nuri Sahin failed to add another goal from the penalty spot minutes later when Wetklo did well to save his kick.
Visitors Mainz were in no way intimidated by the 80,000 sell-out crowd and got their reward for some daring play against the quickest team in the league when Sliskovic scored a minute from time to keep Mainz in fifth place on 44.
Bundesliga top scorer Mario Gomez put Bayern in front after nine minutes with a header from a Ribery free-kick for his 19th league goal this season.
Freiburg could have levelled after 14 minutes but Papiss Demba Cisse saw his penalty saved by Thomas Kraft. The league's second highest scorer made amends three minutes later with his 18th goal, chesting the ball down to fire home from five metres.
Freiburg, who also hit the post late in the first half, managed to hold on despite intense Bayern pressure until the last minute when Ribery took matters into his own hands, weaved past the visiting defence and beat the keeper.
"We were lucky not to be trailing after the first half," said Bayern coach Louis van Gaal. "Then we did play better and could get this win with a bit of luck through Franck Ribery's goal.
Michael Oenning's debut on the Hamburg SV bench was a success as his team crushed Cologne 6-2 with a hat-trick from Mladen Petric.
Ze Roberto, who matched the Bundesliga record for most games by a foreign player when he made his 330th appearance, was also on target converting a second-half penalty.
Werder Bremen beat Nuremberg 3-1 to move four points above the drop zone while Eintracht Frankfurt got their first win this year when they beat St Pauli 2-1 to move up to 14th on 31.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.