The Austrian whipped his effort in off the post with his first touch of the game having come off the bench, earning the reigning champion a hard-fought victory at recently promoted Almería.
The home side actually took the lead with Largie Ramazani powering home inside the first 10 minutes.
Although Lucas Vázquez had an equalizer disallowed just before halftime, he did eventually get his goal, slamming in from close range shortly after the hour mark.
And Alaba’s brilliant free kick from the edge of the penalty box completed the comeback, giving Los Blancos a winning start to their season.
After the game, Real Madrid manager Carlo Ancelotti said he expected a tough start to life as champions.
“We struggled from then on. (Almería) defended very well, we had a lot of shots on goal and once the first one went in, things got easier.”
Madrid began its league campaign in earnest on Sunday having beaten Eintracht Frankfurt 2-0 in the UEFA Super Cup earlier in the week — played between last season’s winners of the Champions League and the Europa League.
Having received a guard of honor by the Almería players when its players came onto the pitch, Real Madrid was pegged back shortly after.
Just six minutes into the game, Belgian forward Ramazani — who came through the ranks at Manchester United — slotted past Thibaut Courtois after latching onto a chipped through ball over the Madrid defense.
According to Opta, the goal was the quickest Real Madrid has conceded in La Liga for 15 years since Sergio Agüero scored for Atlético Madrid.
Having fallen a goal behind, the away side turned up the pressure and thought it had a leveler on the stroke of halftime. Toni Kroos’ delicate cross into the box was volleyed home by Vázquez, only for the linesman to rule it offside.
Both keepers were called into action in the second half, as Courtois had to deny Umar Sadiq with his legs, while Fernando Martínez in the Almería goal stopped Vinicius Júnior, only for the rebound to eventually fall to Vázquez to rifle home.
After the goal, the game swung in Real’s favor as it turned up the pressure, but it still took a moment of magic to get a winner. Alaba, having just come onto the pitch, stepped up and curled the ball home — glancing in just off the post — and past the despairing Martínez.
Although Almería had a very late chance to snatch something from the game — Rodrigo Ely’s header going straight at Courtois — Real Madrid held on to claim the perfect start to the new campaign.
Afterwards, Spanish international Vázquez admitted how stern of a test traveling to face newly-promoted Almería would be.
“They went ahead and that saw them sit even deeper and leave us less space. We were patient and moved the ball well. In the first half, we had good opportunities and were unfortunate not to score, but the team continued to show belief and it’s a deserved win in the end. I’m pleased to have helped the team out with a goal and the most important thing is the win.”
Real Madrid’s win came on the same weekend its archrival, Barcelona, could only manage a goalless draw at home against Rayo Vallecano.
Armed with a host of its new signings — Robert Lewandowski, Raphinha and Andreas Christensen all started while Franck Kessié came of the bench — Barça dominated but could not break Vallecano down, with Sergio Busquets sent off in the dying moments.