Atletico Madrid left it late to see off Girona 2-0 at home on Tuesday as strikes from Diego Godin and Antoine Griezmann.
The win kept up their faint hopes of catching La Liga leaders FC Barcelona.
Team captain Godin broke the deadlock in the 76th minute with the help of the Video Assistant Referee (VAR) after the goal had been initially ruled out for offside against Griezmann.
The technology gave Atletico a lead they barely deserved and France forward Griezmann sealed victory deep in added time.
It was with a delightful chipped finish on the counter-attack, snapping a spell of seven games in all competitions without a goal for his club.
“I sincerely thought that they weren’t going to give us the first goal. We are used to seeing goals like that disallowed when we score them,” Atletico coach Diego Simeone told reporters.
The narrow victory moved Atletico to 62 points, eight behind Barca, who drew 4-4 away at Villarreal late on Tuesday.
Barca host Atletico in a top-of-the-table showdown on Saturday, where a win for the Catalans could effectively end the title race.
The game kicked off in a subdued atmosphere as a large number of Atletico fans waited until the 12th minute to enter the ground.
It was in protest at the team not acknowledging travelling fans after their 3-0 defeat at Juventus in the UEFA Champions League.
The strange atmosphere appeared to rub off on the Atletico players as they were lacklustre in defence in the first half.
Goalkeeper Jan Oblak had to make two impressive saves to prevent Girona’s Ivorian forward Seydou Doumbia from scoring.
The home side, meanwhile, nearly took the lead when a stinging long-range strike from midfielder Koke thumped the crossbar.
Also, Alvaro Morata spurned a clear chance to score later in the first half as he sent an attempted lob just over the bar.
Morata had to be substituted in the second half with a suspected ankle injury, adding to Atletico’s problems in attack ahead of the crucial trip to the Nou Camp.
Striker Diego Costa and winger Thomas Lemar are already battling to be fit for the game.