The Bundesliga club were held to a 1-1 home draw in the first leg, and travelled to Greece knowing any slip up would land them short of a place in the lucrative group stages.
An Adam Szalai strike on the stroke of half time set Schalke on their way, but that lead quickly disappeared after the break when Stefanos Athanasiadis equalised before Jermaine Jones was sent off for a second yellow card.
That threw Schalke's qualification hopes into serious danger, but further goals from Julian Draxler and Szalai – the latter with a 90th-minute winner – helped Schalke to a 4-3 aggregate triumph.
He told the club's official website: "We're very, very happy to have achieved the objective we have worked and fought so incredibly hard for over the last six months.
"It's a vital lift for the team and I think we can take some positives from it for the next few matches.
"It wasn't an intoxicating performance, that's for sure. There was a huge amount at stake and that had a noticeable effect on the players.
"Nevertheless, we had the proceedings well under control in the first half and got the goal. If anything, we ought to have taken the lead in the first two or three minutes.
"We then came out for the second half and conceded the equaliser due to a positional error.
"The red card against us came at a very bad time, of course. We had already gone 75 minutes with 10 men at Hannover (in the Bundesliga on Saturday) due to a sending off."
Schalke's qualification will have eased some of the pressure on Keller, who has seen his team pick up just one point from their first three league matches.