Joaquin scored the winner three minutes from time as Malaga came from behind to beat 10-man Valladolid 2-1.
Manucho had fired the visitors into a shock lead on just nine minutes but Isco levelled the scores eight minutes before half-time with an accurate low finish from Eliseu's cut-back.
The game appeared to being going Malaga's way when Manucho was harshly sent off for a second yellow card nine minutes from time and then the hosts were awarded a penalty when Henrique Sereno felled Javier Saviola in the area, but Joaquin blazed his spot-kick over.
However, the former Spain international made amends two minutes later when he pounced after Dani Gimenez could only parry Martin Demichelis' header back into the danger area.
Malaga boss Manuel Pellegrini had stressed the importance of focusing solely on Valladolid and not Wednesday's Champions League encounter with AC Milan before the game, but that message did not appear to have got through to his players who were punished for a sloppy start.
Omar Ramos nearly scored one of the goals of the season as he danced past five Malaga players before seeing his effort saved by Willy Caballero, but the ball found its way to Manucho and the Angolan continued his great scoring form of late with a fine finish into the bottom corner.
Valladolid were nearly presented with a second inside 20 minutes when Antonio Rukavina pounced on an error by Eliseu but pulled his shot across Caballero and wide of the far post.
Eventually, though, Malaga started to find their passing rhythm, and with Isco at the heart of everything it was no surprise it was he who found the equaliser before half-time as he controlled Eliseu's cross before slotting low into the corner of the net.
Malaga were nearly caught cold at the start of the second period too, as Caballero had to make a smart stop to deny Manucho his second from Patrick Ebert's free-kick.
But again Pellegrini's men grew into the half and Valladolid were thankful for a fine block by Mikel Balenziaga to turn a goalbound effort from Joaquin to safety before Dani was called into action to turn away a header from Roque Santa Cruz.
However, Valladolid could count themselves very unfortunate when a routine challenge for the ball between Manucho and Demichelis was deemed by the referee to be not only a foul but worthy of a second yellow card for the former Manchester United man.
That punishment looked even harsher when Malaga were awarded a penalty with five minutes to go but Joaquin, who has previously looked so deadly from the spot this season, temporarily handed the visitors a reprieve as he fired over.
It lasted only a further two minutes, though, as he reacted quickest to turn home from close range when Dani couldn't hold onto Demichelis' header.
The win ensures Malaga finish the weekend in the top three as they close the gap on Barcelona and Atletico Madrid at the top to two points.