City, who defeated Feyenoord and Sparta Prague to finish as runners-up in Group B, hosted the German giants in front of a crowd of 465 supporters at Holmes Park.
Kwasi-Okyere Wriedt gave the visitors the lead on 13 minutes, but Alex Pascanu's last-gasp equaliser, in the fourth minute of added time, dramatically sent the tie to extra-time.
Following a tense additional 30 minutes in Whetstone, Layton Ndukwu was cruelly the only player to be denied from 12 yards, meaning Bayern left with a 5-4 victory on penalties.
Goalkeeper Viktor Johansson returned to the starting XI for the Foxes, while Luke Thomas came in for Calvin Ughelumba and Ryan Loft replaced trialist Taylor Allen.
In front of the biggest Whetstone crowd of the season, the hosts started brightly, pressing high up the pitch, while Loft had a goal disallowed for offside inside 10 minutes.
However, it was City’s illustrious visitors, who are top of their domestic league in Germany, who took the lead as Wriedt capitalised on a loose ball and fired it into the bottom corner.
Leicester advanced in search of a first half equaliser and, on the half-hour mark, a Kiernan Dewsbury-Hall free-kick was cleared into the path of Khanya Leshabela on the edge of the area.
The South African midfielder had time to compose himself – and his volley had enough power to have alarm bells ringing at the back for Bayern – but it whistled just over the bar.
Just before the break, meanwhile Zimbabwe senior international Admiral Muskwe took matters into his own hands, forcing his way into a positive position in Bayern’s box.
First, Muskwe forced a low save from Ron-Torben Hoffmann, before sending the rebound inches wide of the far post from a tight angle as City’s youngsters knocked on the door.
After the interval, it was the visitors who went close to start with as Bayern captain Nico Feldhahn, 32, one of three permitted overage outfield players, skimmed the bar from 20 yards out.
Loft, too, worked an opening for the Foxes on the right flank, but the former Tottenham Hotspur striker's effort was too tame to concern Hoffmann.
With expressive full-back Ughelumba and forward Tyrese Shade on the pitch in the second period, City continued to show attacking intent in the latter stages.
Leicester refused to go down easily, though, and they led a late onslaught of Bayern's goal. With less than 10 seconds of four minutes of added time to go, they were rewarded.
Ughelumba's cross evaded everyone in the box - everyone apart from Pascanu, who took the ball down and poked it past Hoffmann, sparking wild celebrations among the Club's Under-23s squad.
In extra-time, Callum Wright's floated effort, which went narrowly over, was the best opportunity for the Foxes, while the visitors struggled to carve out an opening.
It eventually went to penalties and, while Muskwe, Wright, Lamine Kaba Sherif and Dewsbury-Hall netted from the spot, Ndukwu's effort was brilliantly stopped by Hoffmann, teeing up Derrik Köhn to win it.
Who impressed?
Positioned alongside the typically solid Sam Hughes in defence, Romania international centre back Alex Pascanu delivered another assured performance for City.
The 20-year-old, a member of his country's senior side, did well to hold off Bayern's talented front line and his late leveller was an example of his qualities in advanced positions too.
Where does it leave us?
Bayern Munich join Southampton, Dinamo Zagreb and Reading in the last-four of the competition, while Leicester turn attentions back to domestic matters.
City’s youngsters are currently sixth in Premier League 2 Division 1, although they’re only two points off third, and they are also in the last-16 of the Premier League Cup.
Coming up…
The Foxes head to Burnley’s Barnfield Training Centre on Friday for a Premier League Cup Round-of-16 tie, a day before the senior sides meet (2:30pm GMT kick-off.)
The details…
City: Johansson, Kaba Sherif, Pascanu, Hughes (c), Thomas (Ughelumba 45’), Dewsbury-Hall, Wright, Leshabela (Tavares 77'), Ndukwu, Loft (Shade 67'), Muskwe
Subs not used: Bramley, Kranthove, Arlott-John, Uche Rubio
Goals: Pascanu 90'
Attendance: 465