Hicham Boussefiane scored the only goal of the game to lift Malaga above opponents Deportivo in the Segunda table, as two huge names of Spanish football engaged in a rare second-tier relegation tussle at La Rosaleda on Wednesday night.
Coach Sergio Pellicer introduced the Moroccan early in the second half, and he provided Malaga's first goal in nearly five hours of league football, finishing emphatically past Deportivo goalkeeper Dani Giménez.
After the clash - which as recently as 2018 was a familiar La Liga fixture - Pellicer said: "If we win against Sporting Gijón [their next match on 13 July], we will celebrate it as if it were a title."
In a nervous opening, both teams appeared wary of losing and were content to play defensively.
When Mohamed Benkhemassa - starting a match for the first time since January - won the ball in midfield, he fed Armando Sadiku who fired the Blue and Whites' first attempt wide.
Juanpi, so often the creative engine spurring Malaga on, forced Giménez into a save midway through the first half with a well-struck free kick.
For Deportivo, their only notable efforts came from Gaku Shibasaki and Ager Aketxe, whose ambitious attempts were off target.
The deflated expressions on managers Pellicer and Fernando Vásquez's faces told the story, as their teams cancelled each other out in the first 45 minutes.
As if to communicate his frustrations, Pellicer made a triple substitution soon after the interval, as Tete Morente, Benkhemassa and captain Adrián made way for Luis Muñoz, Esteban Rolón and Hicham.
It was Hicham who made the telling difference, providing a glimpse of his attacking threat by pouncing on Sadiku’s cross to shoot just wide of the post with half an hour remaining.
Moments later, he burst through Deportivo’s backline and scored masterfully following Juanpi’s defence-splitting pass, deciding a turgid game in Malaga’s favour and distancing them further from the relegation zone with three games remaining.