Karim Benzema marked his first start back from injury with a 35th-minute headed goal at the far post from Cristiano Ronaldo's perfect cross.
Malaga withstood the hosts' numerous second-half chances before Cazorla curled the ball over the defensive wall and into the far corner beyond goalkeeper Iker Casillas in the second minute of added time.
Madrid has won 18 of 21 games in all competitions at the Bernabeu this season, with two losses to three-time defending champion Barcelona the only blemish until Sunday. Barcelona put pressure on Madrid's chase for a first league title in four years with a 2-0 win at Sevilla on Saturday.
"We didn't expect this result but that's part of football," said Ronaldo, who along with his teammates donned shirts in support of Barcelona defender Eric Abidal, who is set for a liver transplant. "There's no need to sound the alarm with an eight-point advantage. We're in good shape."
Malaga gave Madrid a scare in the fourth minute after Cazorla found Jose Rondon, who made a nice run, but Casillas tipped the chance wide.
Malaga 'keeper Willy Caballero rushed out to deny Ronaldo two minutes later in a first half marked by back-and-forth opportunities, with Rondon also troubling Madrid's center backs.
Malaga's Francisco "Isco" Alarcon shot wide in the 15th with his team attacking on the break. As the match progressed, Madrid seemed to improve with Benzema working a perfect exchange with Ronaldo but firing wide just before scoring his 14th league goal.
Madrid started the second half strongly, but a lack of precision inside the Malaga area was to blame for an inability to extend the lead. Malaga's Ignacio Monreal cleared Kaka's cross ahead of Benzema, while Caballero kept Ronaldo from scoring for an eighth straight game with a great reaction save in the 60th.
Mesut Oezil and Kaka drove Madrid's attack. Substitute Jose Callejon headed Oezil's cross just wide in the 69th, then Benzema was guilty of a glaring miss in front of Caballero.
While Ronaldo and Marcelo had decent penalty appeals turned down, Cazorla was fouled by Madrid substitute Esteban Granero to set up his 25-meter equalizer that kept Malaga joint fourth with Levante for the last Champions League spot.
"The referee made two major mistakes but that can happen," Madrid coach Jose Mourinho said before addressing Barcelona counterpart Pep Guardiola's assertion on Saturday that his team's chances of winning a fourth straight title were slim.
"There are still 11 games and 33 points available, so the championship is still wide open. The only thing that matters is our games."
Earlier, Athletic Bilbao followed up another emphatic victory over Manchester United with defeat, the Basque team losing 3-0 to Valencia thanks to a hat trick from Roberto Soldado.
Soldado exploited a fatigued Athletic team missing striker Fernando Llorente that showed little of the intensity and combination football that carried it to a pair of Europa League wins over the Premier League leaders in the past 10 days.
Roberto Soldado jumped on Mikel San Jose's lazy backpass to Gorka Iraizoz to round the Bilbao 'keeper for the 41st minute opener.
Valencia defender Jordi Alba fended off Javi Martinez in the Bilbao area to lay off for Soldado to boot home inside the near post 20 minutes before Athletic was reduced to 10 men in the 77th after Andoni Iraiola was shown a second yellow card.
San Jose's handball set up Soldado's 85th-minute penalty and 15th goal of the season as Valencia followed its own Europa League win with an away victory that consolidated its third-place standing.
Levante is six points behind city rival Valencia following a dramatic 1-0 victory over Villarreal. Xavi Torres jumped on a loose ball from Ruben Suarez's free kick to score the winner two minutes into injury time.
With Villarreal only three points above the drop zone, coach Jose Molina was fired just 11 games in charge since replacing Juan Carlos Garrido.
Ten-man Mallorca became only the second club after Barcelona to beat Atletico Madrid since Diego Simeone took over to start 2012 following a 2-1 victory earlier Sunday.
"It's a step in the wrong direction but it ends here," said Simeone, whose were 2-0 down but helped with Mallorca reduced to 10 men, although Radamel Falcao's penalty miss proved the difference depsite the Colombia striker scoring his 17th goal of the season. "We still have 11 rounds to play and our Champions League aspirations remain in tact."
On Saturday, it was: Getafe 1, Real Sociedad 0; Zaragoza 1, Osasuna 1; Granada 2, Sporting Gijon 1; and Rayo Vallecano 3, Real Betis 0.
Espanyol plays Racing Santander on Monday.