Guerrero ends Mainz's 100 percent record
Mainz, who had won their first seven games, stayed behind Borussia Dortmund on goal difference. Both teams have 21 points after Borussia won 2-1 at Cologne to go top on Friday.
Much-criticised Bayern Munich striker Mario Gomez scored a hat-trick to give the struggling champions a 3-0 win over Hanover 96 and take them to ninth place on 11 points.
Mainz, who were aiming to set a Bundesliga record by winning their first eight games of the season, had several let-offs against Hamburg in a game where both sides created plenty of chances.
Hamburg's 36-year-old Brazilian midfielder Ze Roberto missed an open goal just before half-time, hitting the post after being set up by Ruud van Nistelrooy who had a goal disallowed for a foul on the hour.
Marco Caligiuri hit the post for Mainz while Andre Schuerrle sent a free header straight at Hamburg goalkeeper Frank Rost and then fired over after bursting through the Hamburg defence.
The visitors were on the ropes for the last few minutes until Ze Roberto burst to the byline and pulled the ball back for Peru forward Guerrero, who side-footed into the roof of the net.
Bayern, where strikers Ivica Olic and Miroslav Klose and captain Mark van Bommel this week joined Arjen Robben and Franck Ribery on the injury list, had scored only five goals in their first seven outings.
Gomez, who scored 10 goals last season and had not previously hit the target this term, had largely been confined to a substitute's role after becoming the Bundesliga's most expensive signing.
However, he suddenly found his touch and headed in Hamit Altintop's free kick in the 21st minute before adding two more in the last quarter of an hour when he thumped home Toni Kroos's lobbed pass and headed in a Thomas Muller cross.
"When you play for 90 minutes, you always have better chances and possibilities to excel," said Gomez."
Bayer Leverkusen went third after scoring three times in 11 minutes to win 3-2 at VfL Wolfsburg.
Goals from Brazilian pair Diego and Grafite put Wolfsburg in charge before goalkeeper Marwin Hitz, standing in for the injured Diego Benaglio, missed a free kick and allowed substitute Simon Rolfes to pull one back in the 72nd minute.
Chile midfielder Arturo Vidal levelled with a penalty two minutes later and Rolfes headed the winner in the 83rd.
In the meeting of the teams who started the day in the bottom two places, Schalke 04, last season's runners-up, were held 2-2 by VfB Stuttgart, who fired coach Christian Gross last week and replaced him with Jens Keller.
Stuttgart twice led through Timo Gebhart and Austrian Martin Harnik while Brazilian Edu grabbed Schalke's first and Dutchman Klaas-Jan Huntelaar rescued a point by converting an 80th-minute penalty.
Stuttgart stayed bottom while Schalke moved up one place to 16th.
Werder Bremen beat Freiburg 2-1 and promoted St Pauli won a five-goal thril