Four-time champion Bayern will become the first team to play the final at its home ground after Bastian Schweinsteiger beat goalkeeper Iker Casillas with the final spot kick for the Germans to reach their second final in three seasons.
In the shootout, Manuel Neuer saved from Cristiano Ronaldo and Kaka to put Bayern on course before counterpart Iker Casillas denied Toni Kroos and Philipp Lahm to drag Madrid back into it.
But after Xabi Alonso scored Madrid's first, Sergio Ramos sent his shot high over the bar and Schweinsteiger sent his shot straight down the middle to secure Bayern's place in the final at the Allianz Arena on May 19.
Bayern's fourth victory in five semifinal meetings over Madrid capped an exciting second leg at the Santiago Bernabeu stadium which Madrid won 2-1 to level the aggregate score at 3-3 following Bayern's victory by the same margin last week.
Ronaldo followed up a sixth-minute penalty with his 56th goal of the season in the 14th to put Madrid on course for the May 19 final, only for Arjen Robben to reply with a 27th-minute penalty.