Malaga dominated the first half without creating a clear-cut chance and then after the break Pedro Leon put the visitors ahead with an excellent volley from distance on Saturday.
Ruud van Nistelrooy then headed Malaga level but Nicolas Miku controversially restored Getafe's advantage with a header which also came off his hand.
Malaga appeared to be heading for defeat before Enzo Maresca slotted home in the 88th minute and then two minutes into injury time Baptista acrobatically gave them the three points.
Malaga have 13 points, the same as Valencia, but lead on goal difference. Their stay at the top may be brief, however, with the likes of Real Betis and Barcelona both playing on Sunday.
An early strike from Sergio Canales gave Valencia a 1-0 victory over Granada, the club's first win in three matches. Valencia returned to winning ways after a draw against Barcelona and defeat by Sevilla.
Canales gave Valencia the perfect start with an angled strike from the edge of the area after just three minutes.
Valencia piled on the pressure early on with keeper Roberto Fernandez saving Granada on several occasions notably from Roberto Soldado and Ever Banega but the visitors gradually came into the game with Daniel Benitez their main danger.
Miguel Angel Nadal took charge of the team following Michael Laudrup's resignation in midweek and Hemed put Mallorca in front with a spot kick but Raul Garcia responded with two headed goals for Osasuna.
With 10 minutes to go Hemed kept his cool again from 12 yards to give Mallorca a point. Racing Santander drew 1-1 with Rayo Vallecano with Raul Tamudo scoring for the side from Madrid before Adrian Gonzalez equalised on the hour mark.
On Sunday, Barcelona travel to bottom of the table Sporting Gijon still looking for their first away win of the season in La Liga after draws against Real Sociedad and Valencia.
"To win the title you need to win a lot of matches away from home. We are now faced with another very difficult game and it is down to us to break this poor run," said Barcelona coach Pep Guardiola.
Real responded after picking up just one point from two games with a 6-2 win over Rayo Vallecano and then beat Ajax 3-0 in the Champions League.
They travel to Espanyol with Kaka restored to the starting eleven after a long battle with injury and loss of form.
"I feel a debt to the club for always having stood by me, it would have been easier to leave but I never considered that. I have the dream of triumphing at Madrid and I want to achieve it," said the Brazilian