The 24-year-old left hander allowed three hits, struck out six batters and needed just 89 pitches for the first complete game of his career.
"I think this is the greatest day of my baseball career," Garcia told reporters. "One of the things I have been learning this year - don't worry about what is in the past and what is coming, just focus on the next pitch you are going to make."
Garcia, who made limited appearances with the Cardinals in 2008, had major surgery on his pitching arm to wipe out 2009, however has rebounded this season with an 11-6 record.
He received plenty of offensive support from the Cardinals, who scored three times in the third inning and twice in the fourth to chase Giants (69-56) starter Barry Zito after 3-2/3 innings. The Cardinals added three more runs in the fifth.
"I was having a hard time getting my stuff down," Zito said. "A couple of them were decent pitches. It was tough out there."
St Louis, who are second in the National League Central Division with a 67-54 record, pounded out 15 hits to keep pace in the NL post-season race. The Cardinals remained 3- games behind first-place Cincinnati, and along with the Giants are also chasing the Philadelphia Phillies (70-53) in the NL Wild Card race.
Allen Craig hit a two-run home run and had three RBIs, while Albert Pujols added a run-scoring single and Jon Jay recorded three hits for the Cardinals.
(Editing by Greg Stutchbury)