The Madrid-based side are only one point behind Villarreal, though the team occupying the last Champions League place have a game in hand.
Granada were beaten thanks to a catastrophic day for their centre-backs: Pape Diakhate was sent off after 31 minutes before Jeison Murillo scored an own goal soon after the break.
Pedro Leon made sure of the points with a shot from the edge of the box after 55 minutes.
"Not long ago we were in second-to-last place and now we have won five of our last six games, that's a tremendous run in the first division," said Getafe coach Luis Garcia.
"I'm very happy for my players and our fans. They should enjoy this, but stay humble and keep working."
In the later games, Sevilla let slip a two-goal lead to draw 2-2 at Valladolid and Real Betis lost 2-1 at home to promoted Elche in La Liga.
Colombian Carlos Bacca struck in the second minute and Alberto Moreno's powerful left-foot drive on the half hour appeared to put Sevilla comfortably in charge.
But Valladolid's Manucho surprised Sevilla's goalkeeper in the 81st minute as he leapt high to head into the back of the net.
Three minutes later Ebert snatched victory from Sevilla's grasp as he thumped a free kick into the top corner.
Sevilla climbed to 10th in the table with 10 points. A victory would have ended a 17-year winless streak at the Pucela Stadium.
Rayo Vallecano opened up space from the bottom of the table with a 1-0 triumph at winless Almeria.
The away side were more aggressive in the first period, led by Jonathan Viera, but could not convert their superiority into a goal.
Despite playing a man down after the expulsion of Saul Niguez in the 64th minute, Rayo's Alex Galvez whipped a free kick into the top right corner 14 minutes later to grab the three points.
- Sports & Recreation
- Jeison Murillo