Having beaten Manchester United 2-1 in Basel last December, the hosts pulled off another stunning victory when midfielder Valentin Stocker found the target in the 86th minute having been left unmarked by the Munich defence.
"It was a very difficult game, Bayern made us run a lot," admitted Basel goalkeeper Yann Sommer.
"We have beaten two of the best teams in the world here now -- Manchester United, from who we took four points in total, and Bayern which is unbelievable for a Swiss team.
"But we are a good side and we believe in ourselves so I don't think Bayern under-estimated us."
The defeat compounded Bayern's flagging confidence ahead of the return leg on March 13th at their Allianz Arena, which also hosts the final on May 19th.
While Basel are flying high at the top of the Swiss league, Bayern have won just three of their seven games since Christmas and were held to a goalless draw at bottom side Freiburg last Saturday to leave them third in the Bundesliga.
"It's of course a very bitter defeat for us," said Bayern's Germany goalkeeper Manuel Neuer.
"You can't even say it wasn't deserved, we didn't play well and didn't take our chances. We have to deal with this internally now and fix the problems quickly.
"There were too many mistakes and we have to cut them out."
Bayern president Uli Hoeness added: "It doesn't make sense to look for reasons so soon after the game."
"But 1-0 means we still have a good chance to get a result in the return leg."
Bayern coach Jupp Heynckes started with Toni Kroos in the central attacking midfielder position, flanked by France wing Franck Ribery and Dutch World Cup finalist Arjen Robben.
It meant no place in the starting line-up for Thomas Müller, the top scorer at the last World Cup, while Germany striker Mario Gomez was the lone striker.
Ribery tested Sommer twice early on, but the home side almost took the lead in the 15th minute when defender Aleksandar Dragovic forced goalkeeper Manuel Neuer into a reflex save.
Munich were facing one of their future players as Basel's 20-year-old attacking midfielder Xerdan Shaqiri joins their ranks on July 1st and he found space to exploit the guests' defence on several occasions.
Bayern were missing Germany star Bastian Schweinsteiger, who is out with damaged ankle ligaments, but his replacement in Munich's midfield David Alaba tested Sommer with a curling shot on 30 minutes.
Basel captain Marco Streller squandered a good chance on 48 minutes when he headed straight at Neuer.
Bayern controlled possession after the break while the hosts seemed to run out of steam and sat back on some solid defence with the time running out.
Much to the Frenchman's disgust, Mueller came on for Ribery with 20 minutes left to boost the Germans' attack, but he was at fault for not closing down Cameroon forward Jacques Zoua during the build-up to the winning goal.
With time almost up, the winner came when Stocker was found at the back post by Zoua and the 22-year-old fired home low beyond Neuer to send the home crowd wild.