The visitors scored a goal in the 18th minute and despite not having a dominating presence, managed to take home 3 points. The win places Real Madrid second in group A, while the home team ends up with the group's bottom spot.
Real Madrid took a big step toward salvaging its Champions League campaign on Tuesday with a 1-0 win over Galatasaray.
Eden Hazard set up Toni Kroos for the winning goal in the 18th minute, but Madrid struggled to impose its authority on the Turkish hosts for long periods of the game.
"When you don't score the second goal to put the game away, you end up suffering until the end, and that's what happened," Real Madrid coach Zinedine Zidane said.
After earning only one point from its first two Champions League games, the win lifts Madrid into second place in Group A, five points behind Paris Saint-Germain and two points clear of third-place Club Brugge.
PSG beat Brugge 5-0 away in the other group game Tuesday.
"We had to win, there was no other option for us," veteran Madrid left-back Marcelo said. "We played against a tough team, in a tough stadium, but we managed to get the win that we needed."
Galatasaray nearly took the lead early on when Florin Andone got in behind Madrid's defensive line but saw his shot saved by Thibaut Courtois.
The Belgian goalkeeper stopped another Andone effort from a corner soon after when Marcelo failed to intercept a pass.
Madrid came into the game off a defeat to Mallorca in the Spanish league and Zidane made six changes to the starting lineup.
The most important was the introduction of Hazard, whose fine cut-back pass set up Kroos to score on his 100th Champions League appearance with a deflected shot after Galatasaray had given the ball away cheaply in defence.
Hazard could have made it 2-0 but hit the bar in Madrid's best chance of the second half.
Goalkeeper Fernando Muslera was key to Galatasaray keeping Madrid at bay, making good saves to deny Karim Benzema on two occasions.
The hosts had their chances toward the end, with Steven N'Zonzi and Christian Luyindama producing headed efforts from corner kicks in the last 10 minutes.
Brazilian teenager Rodrygo started for Madrid to make his European debut.
The loss leaves the Turkish champion last in Group A on one point with little hope of qualifying and under increasing pressure as it sits sixth in its domestic league.