The Serie A leaders - and last year's beaten finalists - thought they had done enough to eliminate Bayern in their own Allianz Arena thanks to first-half goals from Paul Pogba and Juan Cuadrado.
But Robert Lewandowski and Thomas Muller struck after the break to send the game into extra time, and Juve's race was run when Thiago Alcantara and Kingsley Coman earned Bayern a 4-2 win.
Guardiola will now watch Friday's draw with interest as he looks to avoid former employers Barcelona and future paymasters Manchester City, with Real Madrid and Paris St Germain also lurking.
Juve broke forward well in the early exchanges and were rewarded for their ambition as a mistake from David Alaba allowed them to score a fifth-minute opener.
The Austrian left-back was uncertain when dealing with Sami Khedira's pass forward and, after goalkeeper Manuel Neuer hesitantly crossed his box to cover, the ball fell to Pogba.
All the midfielder, who turned 23 on Tuesday, had to do was find an unguarded net from the D.
Bayern found Juve's back-line immovable as they attempted to respond, and Muller's tame header from Franck Ribery's cross was easily held by Gianluigi Buffon.
Morata was ruled offside when his chipped finish beat Neuer in the 23rd minute - the Spaniard was soon to get his revenge, though.
After skipping past a swarm of red shirts he fed Cuadrado who, after appearing to falter, impressively dummied Philipp Lahm before smashing home with his right boot.
The home fans fell silent and remained that way until the 42nd minute, when a prone Buffon somehow denied Lewandowski from close range.
Juve were first to threaten following the restart, and they did so twice inside a minute with Morata robbing Alaba for an attempt that got Neuer working, before Pogba fizzed the ball over the crossbar.
In the 73rd minute, Lewandowski - the Pole entered Wednesday's game with seven goals in his last seven European outings - dragged Bayern back into the tie.
By nipping into the six-yard box to head Douglas Costa's cross past Buffon, he beat a goalkeeper who has not conceded in over 900 Serie A minutes.
The 38-year-old was about to ship two goals inside 20 Champions League minutes, however.
The Allianz Arena clock had just ticked past 90 when Muller forced extra time by meeting on-loan Juve midfielder Coman's assist with a powerful header.
Despite the rush of adrenaline Bayern knew they had to be relatively cautious as a third Bianconeri goal would be worth two.
The first 15 minutes passed without incident - it was after the turnaround that Bayern sealed their last eight place.
Substitute Thiago used his fresh legs to burst to convert Muller's lay-off before, with 10 minutes of 120 remaining, Coman hurt his parent club with a close-range coup de grace.