Galatasaray were second in Group H before the match, with the same points as CFR Cluj but ahead on goal difference, and needed to achieve a result that matched the Romanians' at Manchester United to reach the last 16.
Cluj upset the Premier League leaders and group winners 1-0 but the Turkish side matched them by chiselling out a late win on a cold evening at Braga's "quarry" stadium.
After several wasted chances Braga scored the opener through Brazilian attacking midfielder Mossoro within the half-an-hour.
But in the second half Galatasaray reacted. They equalised through Burak Yilmaz after 58 minutes before Aydin Yilmaz pounced for the late winner.
"There's a huge joy within the team now. Our coach Fatih Terim motivated us in a great way at half-time. We needed to make a comeback and we did so" Yilmaz told the UEFA website.
"[Coach Fatih] Terim dressed us down a little in the dressing room but this gave us additional motivation and power".
The Portuguese started stronger and were quicker and more aggressive, dominating a surprisingly apathetic Turkish side who gave the ball away too easily.
Braga's 24-year-old striker Eder wasted a good early chance, denied by a sliding tackle from Galatasaray's Felipe Melo.
After a barrage of opportunities, the Portuguese deservedly went ahead. Mossoro made the most of a poor clearance effort from Melo, picked up the ball outside the box and shot home.
"We started the match badly, just couldn't get into the right mood. We realized that the outcome was going away from our hands and we returned to the game," Burak Yilmaz said.
Galatasaray compensated for a poor start with deadly attacking efficiency.
Yilmaz continued his impressive form in the Champions League and extended his goal tally to six, levelling after 58 minutes with a textbook header.
"Amrabat provided me a very good cross," he said.
With Terim increasingly desperate on the sidelines they completed their comeback through substitute Aydin Yilmaz when the midfielder pounced on a loose ball from a parried save by Braga keeper Quim to grab a memorable winner.
"This hurts. The result does not correspond at all to what happened on the pitch," Braga coach Jose Peseiro told Portuguese television. "We had more chances, more possession, more corners, more free-kicks. We were almost always in control".
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.