Substitute Michael Santos headed a late winner as Malaga twice came from behind to sink 10-man Sporting Gijon at the Estadio La Rosaleda on Friday.
Santos powered the winner past keeper Pichu Cuellar just seven minutes after Gijon defender Lillo had been sent off for a second bookable offence.
Seeking their first win in eight LaLiga games, the visitors made a bright start when Borja Viguera fired home to give them a 13th-minute lead.
Gonzalo Castro and Sandro Ramirez both came close to an equaliser but Duje Cop also missed a fine chance to increase the visitors' lead.
And Gijon were left to rue their missed opportunity when Pablo Fornals drew the home side level in first-half added time.
But Cop made amends four minutes into the second period when he put his side back in front from a set-piece.
Sandro Ramirez made it 2-2 in the 65th minute when he headed home from a corner and, as the pressure mounted on Gijon, they were reduced to 10 men after a second bad foul from Lillo.
The visitors still had the chance to retake the lead when Cop brought a save out of Carlos Kameni, while Santos came close for Malaga when he headed just over from a corner.
Santos made amends in the 78th minute when he took advantage of a similar chance to divert it past Cuellar and ensure his side bounced back from last week's 4-2 defeat at Atletico Madrid.