Paolo Guerrero opened the scoring for the hosts after four minutes, but the Peruvian's strike was cancelled out by Patrick Ebert in the 59th minute.
The winning goal came ten minutes from time by Bastian Reinhardt, following the introduction of Egypt striker Mohamed Zidan, who replaced Guerrero in the 67th minute.
HSV's victory means that they remain in second place with 26 points, just two points adrift of leaders Bayern Munich, who failed to beat mid-table Eintracht Frankfurt at home.
The Bavarians, who hit 27 goals in 11 games, were surprisingly held to a goalless draw at the Allianz Arena, but they remain on top with 28 points.
Werder Bremen registered a vital 1-0 over Hansa Rostock, thanks to a Hugo Almeida strike, to remain third on 24 points.
Struggling champions Stuttgart also edged Cup champions Nurnberg away, but the Bundesliga holders are in 11th place.