He gave up seven runs, four earned, and eight hits in 3 1-3 innings. He walked four and struck out two.
Lynn allowed four runs in the first inning and never appeared comfortable. He allowed just five hits in a 6-0 win over the New York Yankees on Tuesday.
Lynn appeared to hurt his knee while covering first base in the opening inning.
He continued, but said after the game that it bothered him, although he would not use it as an excuse.
“A tough one,” he said. “They got three or four ground ball hits, a broken-bat soft liner to right.”
Lynn received little defensive or offensive support. A first-inning error by second baseman Kolten Wong, on a potential inning-ending double play ball, kept the inning alive and eventually allowed three unearned runs to score.
“If an out is made there,” Lynn said. “We are out of the inning with one run.”
The Giants have won five of six and have the best record in the NL at 37-20.
St. Louis has lost four of five. The Cardinals managed just four hits.
Hudson (6-2) gave up three hits, struck out six, and walked two in improving to 4-4 against St. Louis. Hudson’s previous win against the Cardinals came on July 19, 2007, as a member of the Atlanta Braves. He retired the last 11 batters he faced on Sunday.
The 38-year-old has a 1.75 ERA, second in the NL, and has gone at least seven innings in nine of 11 starts. Hudson missed the final two months of last season with a fractured ankle, but has rebounded with one of the best starts of his 14-year career.