Giovani Dos Santos gave the hosts the lead midway through the first half but everything changed when Getafe were awarded a controversial penalty with 20 minutes remaining.
Diego Castro scored from the spot to equalise and then Adrian Colunga netted twice inside five minutes to condemn Gregorio Manzano's side to back-to-back defeats.
Mallorca began the game with enthusiasm and intensity, dominating their opponents and searching for a goal from the off.
Getafe goalkeeper Miguel Angel Moya had to keep out two strong efforts from Alan Hutton and Victor Casadesus early on but Dos Santos eventually broke the deadlock after 24 minutes.
The Mexican began his run from the right-hand touchline and then cut inside into the box, beating a defender before driving a left-footed shot past Moya and into the net.
It was a stunning goal that and gave the hosts the lift they needed after a long run of uninspiring performances and disappointing results.
Mallorca continued to create the better of the chances before and after the break and Victor Casadesus nearly doubled their lead, but pulled his low shot from the edge of the area inches wide of the far post.
Adrian Colugna had wasted Getafe's only real chance of the game until then but the game changed dramatically in the 70th minute when referee Fernando Teixeira Vitienes gave a penalty to the visitors.
The official thought Mallorca captain Nunes had used his upper arm to block a cross from Getafe, but replays showed the ball had in fact struck him on the chest.
Diego Castro calmly converted the penalty and Mallorca never recovered from this setback.
Colunga appeared in the box unmarked to head in Federico's cross in off the post to give Getafe the lead with eight minutes remaining, and barely four minutes later he volleyed in a cross from substitute Jaime Gavilan to wrap up the points.
Luis Garcia's side will return to Madrid delighted to get their first away win in five games, while Mallorca remain seven points away from safety.
With all the other teams ahead of them to still to play their matches later this weekend, their task of surviving the drop is looking even more difficult.