With the game tied, 8-8, Kevin Young drew a leadoff walk from Veres, advanced to second on the reliever's wild pitch and to third on Adam Hyzdu's single. Right fielder Eduardo Perez bobbled Hydzu's hit, and Young scooted home on the error.
After Pokey Reese's sacrifice, pinch hitter Rob Mackowiak drove Veres' 2-1 offering over the right field wall to make it 11-8.
Veres (3-6), the third of five St. Louis pitchers, lost for the third time since the All-Star break. Starter Bud Smith was roughed up for eight runs and nine hits over 4 2/3 innings.
Scott Sauerbeck (3-0), the fourth of six Pirates to take the mound, retired just one batter to get the victory. Joe Beimel, the Pirates' starter, allowed three runs and seven hits over six innings.
Pittsburgh had 15 hits and matched its highest run production of the season, set May 21 at Chicago.
Hyzdu's fifth-inning grand slam -- the first of his career and the team's first this season -- began a five-run burst that gave Pirates an 8-2 advantage.
St. Louis scored once in the sixth and five times in the seventh, tying the score on Eli Marrero's two-out, two-run double.
It was the Pirates' seventh victory in nine games since the All-Star break, and just the Cardinals' second loss in seven games.