Eric-Maxim Choupo-Moting's 27th-minute backheel was enough to earn Thomas Tuchel's men all three points and keep their hopes alive of playing in Europe next season, while denting Leverkusen's Champions League aspirations.
With Dortmund beating Nurnberg, Leverkusen dropped to third.
It was also their fifth defeat in just over two weeks, having also lost in the DFB-Pokal and Champions League.
Shinji Okazaki almost put Mainz in front in the 29th minute when a cross from the right from Choupo-Moting was helped on by Park Joo-ho to the Japanese forward, who placed his shot straight at Bernd Leno from point-blank range.
Mainz did take the lead in the 37th minute, with the danger again coming down their right.
Stefan Bell's cross was turned in from six yards by Choupo-Moting, who with his back to goal, guided the ball into the far corner with a delightful backheel for his seventh goal of the season.
Loris Karius came to Mainz's rescue just before half-time when he saved from Son Heung-min's header, denying the South Korean again early in the second half.
Stefan Kiessling was sent on with half-an-hour to go and he almost immediately tested Karius from a tight angle.
Julian Brandt wasted another chance as Sami Hyypia's men surged forwards in search of an equaliser, but when Eren Derdiyok headed straight into the arms of Karius, it was clear it was not going to be their day once again.
Mainz almost made it two on a counter-attack, but enough damage had already been done.