The visitors took a seemingly impenetrable 4-0 lead on aggregate when Cristiano Ronaldo scored in the seventh minute, giving Madrid a lead that lasted until half time.
However, Galatasaray enjoyed a mini-revival after the break as Emmanuel Eboue, Wesley Sneijder and Didier Drogba all scored within 15 minutes of each other to put the hosts within two goals of qualification.
Alvaro Arbeloa talked himself into a red card late on, but it was Madrid who had the last laugh as Ronaldo hit his second of the game to secure a 5-3 aggregate win for the Spanish giants.
Here, Sports Mole takes an in-depth look into what was a breathless night of European football in Istanbul.
On target 2
On target 4
Was the result fair?
Both the result on the night and the aggregate score were just about right. In terms of just tonight's match, Madrid looked very comfortable in the first half, but Galatasaray were by far the better team for the vast majority of the second half and deserved their win. They were outplayed in the first leg, though, and that is what ultimately cost them a place in the semi-finals.
In the first half they really struggled to create anything of note despite enjoying more possession than their opponents. Madrid were inviting pressure following their goal, and the hosts just didn't look capable of breaking through. However, the second half was a different story as they dominated the match and set about laying siege to the Madrid goal. The flurry of goals could have been even better had Sneijder buried a glorious chance just after Eboue's goal, but they gave a very good account of themselves on the whole.
Real Madrid's performance
Jose Mourinho would have been delighted with his side at half time. They scored an early goal to seemingly kill the tie off and defended stoutly to stop Galatasaray getting back into the match. They were less convincing defensively in the second half, but Mourinho will know that with such a vociferous fanbase behind a team in the ascendancy, all that you can do sometimes is try to survive the onslaught. They did exactly that and, although it was closer than he would have liked, Mourinho will be happy enough with his side.
Sports Mole's man of the match
Cristiano Ronaldo: This award was extremely hard to give out as no player stood head and shoulders above the rest. Ronaldo, though, weighed in with two goals that proved essential to Madrid qualifying. He didn't have much of a part to play when Galatasaray were dominating but, in the end, it was he who made the difference. One black mark on his performance was missing a sitter, but he also provided a sensational bit of skill to set up Angel di Maria in the first half so the positives far outweigh the negatives.
There are plenty to choose from here. The first was Ronaldo's uncharacteristic miss from about six yards out as he scuffed his shot wide when presented with a chance that you would expect most players to bury with ease. Alvaro Arbeloa also deserves a mention for his ridiculous red card as he picked up two bookings in as many minutes for simply mouthing off to the referee. The biggest gaffe has to go to Wesley Sneijder, however, who dragged a shot well wide when it was easier to score. That would have put Galatasaray 2-1 up and, with what came next, it could have made things a lot more interesting.
Stephane Lannoy didn't exactly have a quiet game. He wasn't popular with the home fans early on as he gave a number of decisions against them, but throughout he was very quick to blow his whistle and award free kicks that broke the game up a bit. His decision to send Arbeloa of was an unorthodox one, but the Madrid full-back must have said something out of place and, if that was the case, then he was right to give him his marching orders.
Galatasaray: Galatasary can now focus solely on the league as they look to protect their four-point lead at the top. They face Karabukspor on Sunday.
Real Madrid: Madrid, meanwhile, have a tough away trip to Athletic Bilbao as they look to secure second place in La Liga.