Bayern overcame the early loss of Arjen Robben through injury to lead when Joshua Kimmich caught out Kaylor Navas with a rasping finish before the half-hour mark.
Zinedine Zidane's European champions never truly recovered their defensive poise from that point, even after Marcelo clattered home a 44th-minute equaliser.
Full-backs were the heroes in both first-half goals, but an awful error by Bayern left-back Rafinha allowed Asensio, on for the struggling Isco, to hand Madrid a significant second away goal.
Cristiano Ronaldo, who had scored in every match in this season's competition, had a strike ruled out for handball – an advantage that would have further flattered Zidane's men after a strangely error-strewn encounter at the Allianz Arena, where Robert Lewandowski's pursuit of a 40th goal this season went awry in untimely fashion.
Thomas Muller was unable to contort himself to convert Lewandowski's hooked cross during the opening minute, setting the tone for a frantic start that continued until Robben pulled up.
The Bayern winger made way due to a problem with his right leg and the pace of the game settled following Thiago Alcantara's introduction.
The first clear chance fell Madrid's way when Dani Carvajal darted in behind James Rodriguez – playing against his parent club – for Lucas Vazquez's return flick and shot too close to Sven Ulreich.
There were questions over Ulreich's opposite number Navas in the 28th minute when Kimmich latched on to James' incisive pass and clattered past the Madrid goalkeeper at his near post.
Bayern then lost centre-back Jerome Boateng to a hamstring injury, but it was Madrid ailing in defence – Navas rushing out to deny Franck Ribery one-on-one as a heavy touch undermined the veteran Frenchman.
Muller had a shot deflected behind at close quarters by Sergio Ramos and Marcelo's drive into the bottom-right corner after he seized upon the loose ball from Carvajal's header certainly came against the run of play.
Lewandowski and Muller had further chances as Madrid floundered under set-pieces in first-half stoppage time and the latter was heroically denied in the goalmouth by a combination of Raphael Varane and Ramos in the 51st minute after Ribery twisted past Casemiro.
Zidane introducing Asensio in place of Isco put Madrid on a clear path of trying to exploit the counter-attack, but that tactic seemed questionable as Muller streamed into space behind Marcelo to cross and his defensive colleagues muddled clear from Lewandowski's header.
However, the Madrid coach's call soon looked inspired.
Rafinha's dreadful pass across midfield set Asensio scampering into the Bayern half. Lucas' return pass left him with work to do, but the 22-year-old clipped an assured finish beyond the advancing Ulreich.
Navas had responded well to his earlier setback and stood firm to deny Ribery in the 63rd minute.
Muller was unable to scramble home when Javi Martinez rose at the back post as another cross caused havoc in the Madrid box before the tireless Ribery had a drive deflected wide in the 70th minute.
Ronaldo then furiously patted his shoulder to protest after the officials spotted he used his arm to control a lofted pass before steering an effort past Ulreich, who denied substitute Karim Benzema with his boot inside the final 15 minutes.
Lewandowski clipped wide from 10 yards in the 88th minute, concluding an uncharacteristically wasteful outing that leaves Bayern facing elimination by Madrid for the third time in five seasons.
Key Opta facts:
- Real Madrid have now won six consecutive Champions League matches against Bayern Munich, their joint-longest run against an opponent in the competition's history, also winning six in a row against Ajax between 2010 and 2012.
- The last three occasions Bayern have scored first in a Champions League match and lost have all been against Real Madrid (also both quarter-final legs last season).
- This was Real Madrid's 150th Champions League win, making them the first team to reach this milestone.
- Cristiano Ronaldo failed to score in a Champions League match for the first time since May 2017, ending a run of 11 consecutive scoring matches in the competition.
- Marco Asensio's last three Champions League goals have been as a substitute, with all of them coming in knockout matches – two against Bayern (last season's quarter-final and this game) and one against Juventus in last season's final.
- No player has been involved in more goals for Bayern in the Champions League this season than Joshua Kimmich (6 – three goals and three assists).