The Portuguese centre-back took advantage of an error from Malaga stopper Willy Caballero to nudge the ball home after 64 minutes, giving his side a win they just about deserved.
Malaga started with just five players who were regulars last season, with the core of Manuel Pellegrini's side from 2012-13 having left the club in the summer.
Where as last season's outfit sought to take the initiative in games, Bernd Schuster's side based their game on cancelling out their opponents rather than trying to create many opportunities of their own.
New signing Marcos Angeleri came close to marking his debut with a goal after five minutes, but could only head a cross from Duda wide of goal.
At the other end, Willy Caballero had to be aware to prevent a cross from Ever Banega creeping into the far corner.
Adil Rami squandered a free header that would have given Valencia the lead, but Jonathan Viera created the best moment of the opening 45 minutes, twisting and turning his way through a number of Malaga players, but was unable to get his shot on target.
Angeleri wasted another header, this time from a set-piece, shortly before half-time.
With neither side taking enough risks to create an opening, it was inevitable that the only goal of the game would come from an error.
Argentinian goalkeeper Caballero came out to collect a high ball following a Valencia free-kick, but fumbled the ball in the face of pressure. The ball landed at the feet of Costa, who could hardly miss.
Malaga were unable to offer much of a response in the remaining minutes, and Miroslav Djukic was able to take three points from his first game in charge of Los Che.