Striker Roque Santa Cruz headed them in front just before half-time and defender Weligton doubled the lead with another header, this time from a corner, two minutes after the re-start.
Getafe pulled one back with a close-range volley from Juan Valera in the 70th minute and Manuel Pellegrini's side endured some nervy moments near the end as they missed a number of chances to settle the game.
Malaga moved level on 53 points with Valencia, ahead of them on head-to-heads, with Valencia missing a chance to keep ahead as they lost 4-2 away to Real Sociedad in Sunday's late match.
Valencia had moved ahead through Roberto Soldado on 25 minutes, but Iñigo Martinez Berridi, Gonzalo Castro and Imanol Agirretxe put the hosts in charge.
Jonas scored in the final minute to make it 3-2 and spark a frenzied finale, but Valencia's attempts to find an equaliser left them open at the back and Agirretxe added a second with almost the last kick of the match some four minutes into injury time.
Malaga may not be able to take up a place in European competition next year if they are successful as they have been handed a one-season ban by UEFA due to financial irregularities.
The Costa del Sol club have appealed to the Court of Arbitration for Sport (CAS) and a decision is expected in mid-June.
- Sports & Recreation
- Manuel Pellegrini