A first-half goal from Schalke's veteran Spaniard Raul means the Royal Blues will face second-division MSV Duisburg in the final at Berlin's Olympic Stadium on May 21.
This is Bayern's second straight home defeat and pressure is mounting on coach Louis van Gaal with signs demanding 'Van Gaal out!' seen around the stadium.
The picture is now much bleaker just a week after the joy of Munich's 1-0 win at Inter Milan in the first leg of the Champions League Round of 16 clash. Bayern are virtually out of the league race and now out of the cup.
Last Saturday's 3-1 defeat also at home to Bundesliga leaders Borussia Dortmund has left Bayern 16 points off the pace with 10 games left and effectively out of the title race.
"Schalke improved their hand with the early 1-0 lead, then they closed up shop in defence," said disappointed Bayern captain Philipp Lahm. "We just couldn't find a solution."
"When we won't be German champions and cup winners, that is not a good season for Bayern."
This was sweet revenge for Magath who was sacked by Bayern in February 2007, despite leading Munich to the league and cup double in the previous two seasons.
"We knew we had a chance, but we could have done with one more goal," said Magath, whose side has struggled in the Bundesliga this season. "We deserved this, even if we didn't contribute much in the second-half and had to defend.
Raul added to Bayern's woes with his 15th goal of the season with a header in the 15th minute.
Bayern poured on the pressure after the break with Dutch winger Arjen Robben just failing to connect with a Franck Ribery cross, while Schalke's Germany goalkeeper Manuel Neuer denied Bastian Schweinsteiger with a header.
Robben was booked with 20 minutes remaining for clattering Neuer as Bayern were again frustrated, while Schalke's Japan defender Atsuto Uchida also picked up a yellow for fouling Lahm.
On Tuesday, Duisburg beat fellow second division side Energie Cottbus 2-1 to book their place in the final.
This is the first time since 2004, when second-tier Alemannia Aachen lost 3-2 to first division side Werder Bremen, that a second division team has reached the final.
With an automatic place in the Europa League on offer for the winners of the cup, Duisburg - currently sixth in the second division - are just one more giant-killing away from a European place.
They have already beaten Bundesliga teams Cologne, in the round of 16, and Kaiserslautern, in the quarter-finals, on the way to the final.