Hamburg midfielder Hakan Calhanoglu gave them a late lead when his deflected shot looped over Nuremberg goalkeeper Raphael Schäfer on 80 minutes.
Nuremberg midfielder Mike Frantz then turned the ball into his own net six minutes later.
Hamburg's Germany goalkeeper Rene Adler pulled off a stunning save to deny Jose Campana's free-kick after Swiss striker Josip Drmic scored the guests' late consolation goal in added time.
With Hamburg desperate to avoid their first relegation from Germany's top flight, Mirko Slomka replaced Bert van Marwijk as coach a month ago and saw his side climb to 14th.
"We've overtaken two teams now, which means nothing other than we now have something to defend – namely, not being in the relegation places," said Slomka.
Nuremberg drop to 15th while VfB Stuttgart, who drew 1-1 at Werder Bremen on Saturday under new coach Huub Stevens, find themselves second from bottom.
Freiburg moved up to 16th, but stay in the relegation places, with a 4-1 win at Eintracht Frankfurt on Sunday as five points now separate the bottom five teams.
At the top of the table, leaders Bayern Munich can be crowned champions next Saturday -- with a record eight games to spare – as their 2-1 win at home to Bayer Leverkusen left them 23 points clear.
The European champions will be confirmed as German champions for the 24th time if they win at Mainz next Saturday and rivals Dortmund and Schalke both draw.
Bayern's relentless march to the title was helped after second-placed Borussia Dortmund suffered a 2-1 defeat at home to Borussia Mönchengladbach earlier on Saturday.
Gladbach earned their first win in ten games to dent Dortmund's confidence ahead of Wednesday's Champions League last 16 clash at home to Zenit St Petersburg when they hold a 4-2 lead from the first leg.
Dortmund are now just one point clear of third-placed Schalke ahead of the Ruhr Valley derby on March 25th.
Wolfsburg drop to sixth after their 1-1 draw at bottom side Eintracht Braunschweig as only three points separate the bottom four clubs including Freiburg, Hamburg and Stuttgart.
Hertha's European aspirations suffered a setback as they lost 2-0 at home to Hanover 96 to stay ninth and four points off the top six.