Julio Baptista's stoppage-time winner was enough to give the home side the three points their play deserved against their stubborn opponents.
The Andalusian outfit were looking to bounce back following their Champions League exit at the hands of Borussia Dortmund on Tuesday, but they were unable to breach the Osasuna defence until Baptista stuck in the 93rd minute.
The home side started brightly and had a clear sight of goal early in the game but Baptista sliced at fresh air with the goal at his mercy after six minutes.
Malaga struggled to create anything clear-cut after the break, with the visitors seemingly content to keep the point they started with.
The game looked to be petering out for a frustrating draw for Pellegrini's men until Baptista pounced on a loose ball to fire beyond Fernandez in the dying seconds.