Madrid were behind early on as Willian Jose converted a third-minute penalty and the home side were unable to pull level before half-time.
Despite Vazquez's red card for two bookings, Madrid remained well on top after the interval and should have had a penalty when goalkeeper Geronimo Rulli seemed to trip Vinicius Jr, but La Real escaped on that occasion and struck again through Ruben Pardo late on to end a run of four consecutive league defeats.
Madrid found themselves with an uphill task as Willian Jose emphatically dispatched his spot-kick following Casemiro's clumsily foul on Mikel Merino.
The hosts created several chances in response – Karim Benzema just missing the bottom-right corner from close range in the 11th minute, shortly before Rulli denied Vinicius from a tight angle.
Luka Modric then forced Rulli into a smart stop down to his right from distance but they came closest just prior to the break – Vazquez's chipped cross-cum-shot coming back off the post.
Madrid turned things up a notch after the break, only for Vazquez to collect a second yellow card for a cynical foul on Merino.
Soon afterwards, Vinicius was unlucky to not be given a penalty when he appeared to be fouled by the sprawling Rulli.
La Real took full advantage, hitting Madrid on the break six minutes from the end and Pardo - a second-half introduction - nodded in Willian Jose's cross to leave Madrid beaten.
What does it mean? Questions marks remain over VAR in LaLiga
There is little doubt that, when used properly, VAR is a good thing for football. But this match proved it is not beyond criticism, as Vinicius was not given a penalty for what appeared to be a clear foul in the second half. It is unclear whether it was reviewed at all, but the fact nothing was given suggests it was not.
Rulli decisive for La Real
Madrid certainly had enough opportunities to win it, but Rulli produced one his best displays for a long time, making several big saves. He has had a difficult time in the last couple of years, but this was a performance that showed his true potential.
Casemiro fails to make amends
It was a day to forget for Casemiro. His early error resulted in the penalty and he never recovered from that as Madrid were poor in midfield. He was unsurprisingly withdrawn for Isco, who produced an improvement.
Key Opta facts
- Real Sociedad have won a LaLiga game against Real Madrid at Santiago Bernabeu for the first time since May 2004, when they triumphed 4-1.
- William Jose's early strike is the fastest penalty goal scored for any team at Santiago Bernabeu in LaLiga in the 21st century (144 seconds).
- Imanol Alguacil is the fourth Real Sociedad manager to win a LaLiga game at Santiago Bernabeu after Raynald Denoueix in 2004, John Toshack in 1994 and Javier Exposito in 1991.
- Vazquez has been sent off for the first time for Real Madrid after 160 games in all competitions.
- No other La Liga team have hit post and bar more times than Real Madrid this season in all competitions (21, level with Barcelona).
- Madrid goalkeeper Thibaut Courtois has conceded 21 goals in 16 games in La Liga this season, only three fewer than in his last campaign for Atletico (24 in 37).
After hosting Leganes in the first leg of their Copa del Rey last-16 tie on Wednesday, Solari's men face a potentially tricky trip to Real Betis in LaLiga next Sunday. La Real will be Betis' opponents in the cup before returning to league action at home to Espanyol a week on Monday.