Antoine Griezmann earned Atletico Madrid a 1-0 win against derby rivals Rayo Vallecano for the third consecutive time in this fixture, moving Diego Simeone's side back up to second place in LaLiga.
Atletico had lost their past two LaLiga games, including a derby defeat at home to Real Madrid last weekend, and they gave another below-par performance at Vallecas on Saturday.
Rayo, who remain in LaLiga's relegation zone after a third straight loss, had the better chances with Adrian Embarba and Raul de Tomas calling Atletico goalkeeper Jan Oblak into action.
But Atletico marked Simeone's new contract with three points after Griezmann's 74th-minute volley deflected in to give the striker his eighth goal in his past six appearances against Rayo.
Saul Niguez headed off target from Griezmann's cross in the second minute but the first big chance fell to Rayo with Embarba unable to beat Jan Oblak after being sent by De Tomas.
Atleti were indebted to Oblak for an even better save in the 34th minute, the goalkeeper twisting to deny Embarba after another incisive De Tomas pass.
Simeone sent on Costa for his first appearance since the start of December as Atletico fielded the fit-again striker with Griezmann, Alvaro Morata and Thomas Lemar across the front.
But Rayo continued to threaten with Oblak quick off his line to deny De Tomas after he ran on to a sensational long ball from Alejandro Galvez.
De Tomas had a weak penalty appeal turned down after a challenge from Jose Gimenez and Atletico finally broke the deadlock in the 74th minute.
Morata won the ball in the box and Griezmann pounced on the loose ball with goalkeeper Stole Dimitrievski beaten by a decisive deflection on the match-winning strike.
Rayo had one big chance to claim a deserved point in added time but Oblak held on to Abdoulaye Ba's header.