Flaherty picked up his eighth win of the season on Tuesday at Busch Stadium in St. Louis. The right-handed hurler allowed just four hits, while throwing five strikeouts in the victory.
Jose Martinez and Tyler O'Neil had the biggest hits of the game. Martinez hit a two-run home run in the first frame, while O'Neill went yard with a two-run shot in the fourth frame. Martinez's mash traveled 402 feet, while O'Neill's went 436 feet.
Pittsburgh got a run back on a ground ball single from Colin Moran in the fifth inning. The Pirates cut the Cardinals' lead in half when Adeiny Hechavarria plated Josh Bell in the eighth inning, while grounding into a double play.
But Greg Garcia increased the Cardinals' lead once more when he brought in Paul Dejong with an RBI single in the bottom of the eighth frame.
The Pirates and Cardinals resume the three-game National League Central series at 8:15 p.m. Thursday in St. Louis.