Flaherty (8-0) allowed two runs on four hits and four walks while striking out seven in six innings of work. He is the first Cardinals pitcher to win eight straight starts since John Tudor and Joaquín Andújar each accomplished the feat in 1985.
Kodi Whitley relived Flaherty in the seventh and allowed three runs on a walk and two hits without recording an out. Tyler Webb, Génesis Cabrera and Ryan Helsley bridged the gap to Alex Reyes who struck out the side in the ninth to earn his 13th save in as many opportunities.
Tommy Edelman had two hits and drove in three runs and Paul Goldschmidt had three hits and two RBIs as the Cardinals improved to 5-0 against Pittsburgh this season.
Pirates starter Trevor Cahill (1-5) allowed four runs on two hits, two walks and a hit batter. He departed the game suffering from left calf discomfort with the bases loaded and nobody out in the bottom of the second inning.
Cahill was removed while facing Flaherty after walking Harrison Bader and Justin Williams and plunking Edmundo Sosa with a pitch. The Pirates say he is day-to-day.
Flaherty lined the first pitch he saw from reliever Duane Underwood to right field to drive in Bader. Edman followed with a two-run single, and Goldschmidt and Nolan Arenado each added RBI singles to give the Cardinals a 6-0 lead.
Gregory Polanco hit a two-run home run to right field in the fifth inning. It was his fourth of the season and the first allowed by Flaherty in four May starts.
St. Louis scored twice in the bottom of the fifth to expand its lead to 8-2.
Pirates: 3B Ke’Bryan Hayes (left wrist strain) participated in a simulated game pregame. The team expects to send him on a rehab assignment with Triple-A Indianapolis Thursday or Friday. … RHP Chad Kuhl (right shoulder discomfort) threw 42 pitches allowing just one hit with five strikeouts in three innings in a rehab start for Indianapolis.
Cardinals: RHP Miles Mikolas (right shoulder) will be activated off the injured list to start against the Chicago Cubs on Saturday. Mikolas will be making his season debut after missing the entire 2020 season with a right flexor tendon.
Pirates: RHP Wil Crowe (0-2, 4.35) ERA will get the start to open a four-game series at Atlanta Thursday night. The Braves will counter with LHP Drew Smyly (2-2, 5.23 ERA)
Cardinals: RHP Carlos Martínez (3-4, 4.35 ERA) will be activated from the injured list to start the opener of a three-game series Friday night against the Chicago Cubs.