A last-gasp Jose Paolo Guerrero winner meant Hamburg became the first side to tame Mainz this season.
With barely a minute left of normal time, Ze Roberto picked the pocket of substitute Radoslav Zabavnik before squaring to Peruvian striker Jose Paolo Guerrero who fired the ball into the roof of the net.
The first real opportunity of the match arrived on eighteen minutes when Bo Svensson lost the ball, allowing Hamburg to counter. Piotr Trochowski showed brilliant close control on the edge of the box before firing a low shot, which was smartly parried behind by Christian Wetklo.
Mainz began to turn the screw around the midway point of the first period. Frank Rost was forced into a good stop from Lewis Holtby's stinging effort. Moments later, Adam Szalai raced clear but was denied by a vital last-ditch challenge from Guy Demel.
In a frantic passage of play that contrasted sharply to the opening exchanges, Ruud van Nistelrooy spurned a glorious opportunity when through on goal, tamely shooting into the chest of Wetklo.
Four minutes before half-time, Van Nistelrooy again found himself in on goal but this time unselfishly opted to lay the ball across for the onrushing Ze Roberto but the veteran somehow cannoned his shot against the post.
With Joachim Loew in attendance for the second successive Mainz game, all eyes were on Lewis Holtby and Andre Schuerrle. Schuerrle almost broke the deadlock five minutes into the second half but was denied by a superb block from Heiko Westermann. On 57 minutes the young striker then headed straight at Rost when in acres of space at the back post.
Van Nistelrooy thought he had the opening goal on the hour mark when his header dribbled over the line after Wetklo had spilled the ball but he was adjudged to have fouled Nikolce Noveski.
Holtby and Schuerrle then combined to almost devastating effect on 66 minutes with the latter failing to keep his effort down from close range before it was Mainz's turn to strike the post through Marco Caligiuri after a beautiful curled effort. Holtby then broke clear after a glorious pirouette before Rost came to the visitors' rescue with another save.
Guerrero's late winner means that Mainz remain in second place. They travel to the Bay Arena next week to face Leverkusen. A rejuvenated Hamburg host champions Bayern Munich on Friday night.
For all the German news you can handle, check out Goal.com's Germany homepage and join Goal.com USA's Facebook fan page!