They continued to push for the opening goal and almost got it 10 minutes before the break as Costa once again advanced into the box before seeing his curling effort stopped by Rafa.
The deadlock was finally broken five minutes later as Juanfran's delivery was nodded in by Godin with Codina in no-man's land having attempted to collect the cross.
Atletico were handed a glorious chance to double their lead in the 65th minute when Angel Lafita brought down Costa inside the box, conceding a penalty and being shown a red card to add insult to injury.
Costa stepped up himself to take it, but Codina guessed the right way and made the save before recovering in time to deny Adrian Lopez on the rebound.
The points were eventually sealed six minutes from time, however, as Costa slid in to convert Adrian's cross from close range, although he collided with the post and picked up an injury in the process.