Already leading 3-0 from the first-leg last week, it took Los Blancos just eight minutes to build on their advantage as Sami Khedira crossed for Cristiano Ronaldo to prod home from close range.
However, after Ronaldo had missed a gilt edged opportunity to double his tally on the night, Galatasaray produced a remarkable comeback as Emmanuel Eboue thumped in an equaliser from the edge of the box.
Wesley Sneijder and Didier Drogba then added two goals in a minute to ensure a nervy final 18 minutes for Madrid.
Alvaro Arbeloa saw two quick-fire yellow cards a minute from time to ensure he will miss the first-leg of the semi-final, before Ronaldo sealed Madrid's path into the last four with another sweet strike in stoppage time -- his 49th in the Champions League taking him to fifth on the all-time list.
"It is our own fault it became complicated," Ronaldo told Spanish TV station TVE.
"In football you cannot gift anything. Today that is what happened and it ought to serve as an example for the future to play for 90 minutes."
Ronaldo's brace also took him past club legend Alfredo di Stefano into 11th place in the all-time records for goals scored in European competitions, but he was more concerned with having achieved a place in the last four.
"The team is fine, they gave me good passes and I did my job, which is to score goals.
"We are very happy to have qualified. We have achieved our objective and now we wait to see who we will play next."
Madrid had been warned about the wall of noise they would face in Istanbul but just like in the first leg, they started in perfect fashion.
Mesut Ozil was once more the creator for the Spanish champions as he slipped Khedira through on the right side of the area and his driven cross was turned in by Ronaldo for his 10th goal in just 10 Champions League appearances this season.
Ronaldo then played in Angel Di Maria for what would have been the visitors' second on 25 minutes had it not been for an incredible save from Fernando Muslera to turn the Argentine's driven effort over the bar.
The hosts created hardly anything of note going forward in the first-half, but Sneijder did test Diego Lopez's handling with a powerful drive from the edge of the area after Madridhad switched off from a short corner seven minutes before half-time.
However, the momentum of the game swung in two incidents within 60 seconds of one another just before the hour mark.
Firstly, Ronaldo uncharacteristically scuffed wide with the goal at his mercy before Eboue sent a rocket of a shot into the top corner from Sneijder's cut-back.
Sneijder then missed a glorious chance to put the home side in front as he side-footed Fabio Coentrao's misplaced clearance wide.
The Dutch international made no mistake with his next opportunity, though, as he skipped past Raphael Varane and slotted confidently past Diego Lopez with 19 minutes to go.
And a minute later the tie was truly back in the balance as Drogba brilliantly backheeled Nourredine Amrabat's cross into the far corner.
Arbeloa was stupidly dismissed for two yellow cards in barely a minute as he first brought down Sneijder then saw a second booking for arguing with the referee.
But Madrid's fears were eased in stoppage time when Karim Benzema pulled the ball back for Ronaldo to drill home and cap an incredible evening's entertainment.
Kareena Kapoor Khan looks in fab shape after weight loss! See photos
Mumbai food: 9 dishes to try during 9 days of Navratri
Photos: Hrithik Roshan, Nidhhi Agerwal and Adah Sharma walk the ramp
Photos: Shah Rukh Khan spotted with new set of wheels
Photos: Kareena Kapoor Khan, Kangana Ranaut at the Mumbai airport