A brace from Mark Uth and an early equaliser from Nadiem Amiri secure a much-needed three points for Hoffenheim.
Jhon Cordoba's opener and a late Jairo strike were not enough, and meant that Mainz missed the chance to rise to the lofty heights of fourth.
Both sides made two changes coming into the game. Hoffenheim and Julian Nagelsmann opted to bring in Mark Uth and Pavel Kaderabeck for the suspended Andrej Kramaric and benched Ermin Bicakcic. As for Martin Schmidt, he replaced Stefan Bell (knee) and Giulio Donati (suspended) with Alexander Hack and Daniel Brosinski.
Both sides trade early blows
Despite the resolute defensive effort on show in Bremen, it was a simple piece of play that broke the deadlock in Sinsheim.
After Hoffenheim lost the ball in the Mainz half, Jairo picked up possession and played an inch-perfect pass into the path of Cordoba. He steadied himself before sliding the ball through the legs of Oliver Baumann. Simple, but effective.
Where they may previously have folded, Hoffenheim stayed resolute. After Philipp Ochs went on a surging run down the left, he found Kevin Volland inside the area. The TSG star picked out Eduardo Vargas in the area, who duly slid the ball across to Amiri. The youngster kept cool, sending Loris Karius the wrong way and leveling the match.
Mainz were on top in the latter stages of the half, with Jairo, Danny Latza and Christian Clemens all forcing good saves from Baumann. At the other end, Amiri very nearly added a second for the hosts. All in all, the Karneval club could count themselves unfortunate to not have a lead.
Uth helps ease Hoffenheim's woes
Mainz were on top in the second half and seemed to be side most likely to make a breakthrough, that nearly came through a Clemens effort that narrowly flew over the bar.
Just as the game was falling into a slight lull, a magic moment from Kevin Volland gave Hoffenheim the lead. After collecting the ball on the left, he drove towards the by-line before producing a fantastic turn of pace to evade Daniel Brosinski. He played the ball into Uth's path, touching it around Hack and firing under Baumann.
Niklas Süle then made a vital intervention to clear a header off the line, which proved crucial moments later. Pavel Kaderabeck burst away down the right and continued running until he got into the box, before cutting the ball back to Uth. The forward was two yards out and poked home to seal the win.
Mainz were not down and out by any means, and found a way back into the contest with a stunning strike from Jairo. After collecting the ball on the edge of the area, he rounded his marker before firing across goal and into the far corner. Despite a late surge they couldn't quite grab another goal, with Hoffenheim jubilant to have gained all three points.