Barcelona have 72 and Real are three points off the pace on 70 after suffering their second consecutive defeat.
"We weren't precise with our passing and we needed to link up better. We suffered against a side that went out to play on the counter," Atletico coach Diego Simeone said.
"We moved the ball around better in the second half with the midfielders linking up with the forwards and I think we did enough to win the game."
Atletico played at their usual high intensity but they struggled to break down a Granada side who also worked hard.
Arda Turan fired wide from a tight angle and the Turk also failed to hit the target when well placed in the centre of the penalty area after being set up by Cristian Rodriguez.
Granada came more into the game with Youssef El-Arabi heading wide from a corner and the striker had a powerful shot from outside the area that went close.
It was not one of Atletico's strongest performances but after Costa broke the deadlock they were able to control the match by maintaining possession in the middle of the pitch.
In the night's other match, Argentine striker Joaquin Larrivey kept his nerve from the penalty spot in the 90th minute to give Rayo Vallecano a late 1-0 home win over Osasuna.
Victory for Paco's side sees them leapfrog Malaga and Elche into 13th place. Osasuna remain in 17th, a point above the relegation places.
- Sports & Recreation
- Diego Simeone