Schalke, knowing they needed at least one goal following the 1-1 draw in Germany, came close to opening the scoring in the second minute when Adam Szalai broke free of the home defence before firing a shot wide.
Salonika struggled to assert their dominance in midfield as the visitors started to take control of proceedings with some long spells of possession.
However, a lack of quality in the final third of the pitch meant Schalke had to wait until the stroke of half time to take a deserved lead.
Salonika looked a much more dangerous team after the break, with Giannis Skondras hammering a shot into the side-netting from a tight angle.
The scores were level again in the 53rd minute as Salonika picked apart the Schalke defence and Stefanos Athanasiadis finished confidently to earn parity for the Greek side.
Schalke's hopes of qualification were dealt a blow when Jermaine Jones was sent off for a second bookable offence in the 64th minute.
However, the German side reacted superbly and they regained the lead just three minutes later when Draxler raced away from the Salonika defence before rounding Sanz and tapping the ball in from close range.
Schalke looked destined for the group stages but they were given a scare when Salonika pulled a goal back nine minutes from time, with Kostas Katsouranis heading home an inviting cross from Miroslav Stoch.
Szalai made sure there were no surprises in the closing stages of the contest as the forward collected an inch-perfect pass from Draxler before drilling in his second of the night to secure his team's progress into the group stages.