Garcia sealed the game for the visitors when he opened the scoring in the seventh minute, receiving the ball inside the box and rifling it past goalkeeper Marc-Andre ter Stegen to a wave of whistles at the Camp Nou.
Barcelona failed to convert a number of golden chances despite going agonizingly close to an equalizer with the referee playing 14 minutes of stoppage time at the end of the second half.
“These mistakes cannot be repeated and they have happened to us again. They are very good opportunities that we let pass us by,” Barcelona coach Xavi Hernandez told reporters.
“I leave angry, disappointed, because today was… a repeat of what happened against Eintracht (Frankfurt), as well as Cadiz. We lacked a lot of effectiveness.”
“The fans have been brilliant — ten out of ten” — Xavi https://t.co/zwc47mlX7G
– FC Barcelona (@FCBarcelona) 1650837992000
Real Madrid now need only one point from their last five games to secure the title, while Barcelona are second on 63 points, 15 behind Real and level with Sevilla in third.
Barcelona had a good chance to level in the 25th minute but a strike by defender Jordi Alba from the edge of the box was just off target, touching the outside of the right post.
Gavi then lashed the ball against the crossbar in the 42nd, while Spain international Ferran Torres netted on the follow-up but his effort was disallowed for offside.
Xavi introduced three forwards off the bench in the second half as Memphis Depay, Adama Traore and Luuk de Jong all came on before the 71st minute.
Traore caused a scare in the Rayo defense in the 76th minute with a stunning cross into the penalty area, but it was cleared to safety by Rayo winger Isi.
“We need to keep going — we have five finals left” — Xavi after #BarçaRayo https://t.co/SRKV4FcWBy
– FC Barcelona (@FCBarcelona) 1650836772000
Four minutes later Depay tried his luck from the edge of the box but his shot, straight down the middle of the goal, was saved by goalkeeper Stole Dimitrievski.
Barcelona continued to press in stoppage time and threatened a number of times, but Rayo clung on for the three points which steered them further away from the relegation zone.
“I think we generated many clear chances to at least equalise. If we equalized with enough time, I think we would have won it. We have complicated our own qualification for the Champions League,” Xavi added.
“If we want to hear the music of the Champions League next season, we have to match (the Champions League teams) in their enthusiasm.”
Barca next host relegation-threatened Mallorca on Sunday. Rayo, who moved up to 11th from 14th in the standings following the game which was originally scheduled to be played in January, are home to Real Sociedad earlier that day.