Matt Adams' two-out RBI triple in the fifth gave St. Louis a 5-4 lead. It was Adams' team-high fifth triple.
The Cardinals struck for four runs in the second. Peralta hit a run-scoring double down the left-field line and scored on Taveras' one-out double that hit just in front of the wall in center.
Matt Carpenter added a two-run double for the Cardinals. Rymer Liriano tried to catch the line drive but it landed in front of him and bounced by him.
But San Diego got the runs back against Shelby Miller in the third.
Gyorko had an RBI single and rookie Jake Goebbert hit a bases-loaded triple with two down.
"You get a four-run lead you don't go out and give up four runs," Miller said. "Unacceptable. Obviously, it doesn't sit well with me. I should have done a better job of making pitches."
Seth Smith's third hit in the eighth drove the Padres' final run.
Padres: 3B Yangervis Solarte returned to the lineup after missing two games with a mild left oblique strain. He was the leadoff spot, the third time he has done so this season.
Cardinals: RHP Michael Wacha (right shoulder) threw off the bullpen mound before the game. He threw 30 pitches. He had not pitched off a mound since his June 17 start against the New York Mets. He will undergo an MRI on Monday to check the shoulder.
St. Louis CF Jon Jay was hit twice by a pitch. He also was hit by a pitch twice Friday, giving him four in two games. He leads the major leagues with 14 hit by pitches.
CARDINALS HALL OF FAME
Willie McGee, Jim Edmonds, Mike Shannon and the late Marty Marion were honored Saturday with their induction into St. Louis' newly created Cardinals Hall of Fame.
Rookie RHP Odrisamer Despaigne (3-3, 2.72 ERA) faces Cardinals ace Adam Wainwright (14-7, 2.34 ERA) in the finale of the four-game series Sunday. Despaigne pitched seven scoreless innings in a victory over Colorado in his previous start. Wainwright is 5-2 with a 1.47 ERA against the Padres. He is coming off a 3-0 loss at Miami in his last outing.