VfB Stuttgart moved out of the relegation zone when substitute Sven Schipplock snatched an 88th-minute goal as they beat St Pauli 2-1 in the day's other game.
Mainz were playing the ball out of defence from a goal-kick when Renato Augusto, running back after taking a corner, stole it off Bo Svensson in the 82nd minute.
The Brazilian advanced before whacking a curling shot past goalkeeper Christian Wetklo from 20 metres, leaving Mainz's perplexed defenders looking at each other in disbelief.
Leverkusen, in second spot, have 52 points from 26 games and reduced the arrears on Dortmund who lost 1-0 at Hoffenheim on Saturday. Both teams have eight matches to play.
"It was very important for us to win especially after losing that Europa League match to Villarreal," said goalkeeper Rene Adler whose Leverkusen side lost 3-2 at home to the Spaniards on Thursday.
Mainz, who led the Bundesliga earlier this season, are fifth with 43 points.
Until Renato Augusto struck Leverkusen looked as if they would pay for failing to take their chances.
Arturo Vidal and Stefan Kiessling squandered excellent openings within a minute of each other in the second half, both created by Renato Augusto.
Vidal blasted his effort over the bar after being found free on the left and Kiessling shot tamely at Wetklo after being sent clear of the defence by the former Flamengo player's chipped pass.
At the other end Andrea Schuerrle wasted Mainz's best chance by firing high and wide from a Christian Fuchs cross.
Stuttgart, champions in 2006/07, jumped from 17th to 13th with their win at St Pauli who dropped to 16th, the relegation playoff spot.
Both teams have 28 points with Kaiserslautern and Eintracht Frankfurt sandwiched inbetween.
VfL Wolfsburg, beaten 2-1 by Nuremberg on Saturday, are 17th, two points behind St Pauli, while Borussia Moenchengladbach are bottom.
Fabian Boll put St Pauli ahead after 19 minutes but Zdravko Kuzmanovic levelled five minutes later. Schipplock had only been on the field for five minutes when he grabbed the winner for Bruno Labbadia's team.
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.