Thorten Fink's side took the lead through Maximilian Beister in the 52nd minute with Artjoms Rudnevs adding a second 13 minutes later.
Although Klaas Jan Huntelaar reduced the arrears 10 minutes from time for third-placed Schalke, it was Milan Badelj who had the last word as Hamburg bounced back from a 2-0 defeat to Fortuna Dusseldorf last Friday night to get their own push for a place in Europe back on track.
The opening 15 minutes belonged to the home side, although they were unable to create any dangerous chances.
Schalke then kicked into gear and Chinedu Obasi's effort was cleared off the line by Tolgay Arslan in the 21st minute.
Huntelaar and Teemu Pukki both had chance to put the visitors in front before Heiko Westermann wasted Hamburg's first big chance against his former club.
Beister then surprised Lars Unnerstall with a shot from outside the penalty area which put Hamburg in front seven minutes into the second half.
Beister then started the move which led to Hamburg's second with a backheeled pass to Dennis Diekmeier, whose cross was met by Rudnevs near the penalty spot, and the Latvian struck the ball past Lars Unnerstall.
Schalke finally awoke with Jefferson Farfan going close to scoring in the 68th minute.
Hamburg appeared to be defending well until Tomas Rincon handled the ball inside the penalty area in the 80th minute.
Huntelaar missed the spot-kick, but followed up and slotted in the rebound.
Schalke threw everybody forward in search of an equaliser, but instead they got caught out on the counter attack in stoppage time when Tranquillo Barnetta could only stop Dennis Aogo with a foul, and Badelj, in the injury-enforced absence of regular penalty-taker Van der Vaart, converted from the spot.