Lynn finally earned his first career victory against San Francisco this time, outpitching Ryan Vogelsong and hanging tough into the eighth before leaving with a right ankle injury in the Cardinals' 6-0 win Saturday.
The big inning hurt Vogelsong as the ailing Giants were shut out for the 12th time and eighth at home.
The NL Central-leading Cardinals broke open a scoreless game with four runs in the fifth.
"The big inning killed us there. We couldn't stop them," Giants manager Bruce Bochy said.
Lynn (11-8) pitched neatly into the eighth inning before leaving with the ankle injury that's not considered serious but sure had manager Mike Matheny nervous.
The right-hander awkwardly came off the mound to field Juan Perez's leadoff chopper in the eighth and twisted his ankle trying to throw to first. That was Lynn's final batter, and he exited with a mild ankle sprain that will be reevaluated Sunday.
"As long as I can get up and walk, I'll be able to pitch next time out, so I'm not worried about it," he said.
Lynn gave up six hits, struck out two and walked two. He had been 0-4 with a 6.33 ERA in his previous four regular-season starts against San Francisco and 0-1 in three postseason outings.
The Giants beat the Cardinals in the NL championship series on the way to titles in '12 and last fall.
"I'm surprised any of our guys have beaten this team," said former Giants catcher Matheny, whose club has won five of the last seven at AT&T Park. "It just seems like every time we're playing them we're walking off with our head hanging down, especially here. A lot of great memories as a player here wearing their colors but a lot of bad ones playing here wearing these ones, ones that stick. Last night it felt like we were thrown right back last year, the weather. We go from Arizona to here and it feels all of a sudden like you're in the postseason. You had buzz in the crowd."
Vogelsong (9-10) beat Lynn 2-0 on Aug. 18 at Busch Stadium. He also twice defeated the Cardinals during the Giants' 2012 postseason run to the World Series championship. But Vogelsong failed to reach five innings for the second straight start and has pitched through the sixth just once in his last seven starts.
He allowed four runs on seven hits and three walks in 4 2-3 innings on a day catcher Buster Posey sat out to rest a sore left elbow that was hit by a pitch Friday night.
"Everybody knows we're banged up, but I'll take the ball with whoever is behind me," Vogelsong said. "We always believe we have a chance to win."
The right-hander had been 2-0 with a 2.70 ERA over his previous three starts at AT&T Park. His defense gave him inning-ending double plays in the first and third before he ran into trouble in the fifth.
Piscotty later had an RBI triple and finished with four hits playing at home in the Bay Area, a day after the Cardinals' five-game winning streak was stopped by the Giants.
Cardinals reliever Sam Tuivailala, recalled from Triple-A Memphis on Friday, struck out three in the ninth and allowed two runners.
Cardinals: OF Matt Holliday, sidelined since July 30 with a strained right quadriceps muscle, was reevaluated in St. Louis. ... Reliever Jordan Walden, out since April 29 with a strained right biceps, also has been seen again by team doctors. ... Closer Trevor Rosenthal, put on the paternity leave list Friday, is set to rejoin the team Monday at home against Washington. He and his wife welcomed a baby girl Friday night.
Giants: 2B Joe Panik, out since Aug. 2 with low back inflammation, did some running and hit in the indoor cage. He will take live BP on the field Sunday and is set to begin a rehab assignment Tuesday with Triple-A Sacramento. "It's been a little while," he said. "It's nice to be wearing baseball pants again."
Cardinals: LHP Jaime Garcia (6-4) tries to win his fourth straight decision and complete an unbeaten August. He is 9-3 with a 1.64 ERA over his last 14 road starts dating to Sept. 15, 2012.
Giants: RHP Chris Heston (11-7) makes his first start since Aug. 17 at St. Louis and is 0-2 over his last four starts, going fewer than five innings in three of those. He was given an extended break in the minors.