ST. LOUIS (AP) Adam Wainwright relished the chance to stop a skid.
The Cardinals' ace worked seven effective innings to help St. Louis beat Pittsburgh 5-1 on Thursday to avoid a four-game sweep and end the Pirates' season-best seven-game winning streak.
''Today, I really wanted to push it as long as I possibly could,'' Wainwright said. ''I was having fun mixing and matching and mixing my delivery speed. I was pitching out there, that's how I did it in 2014.''
Wainwright (8-5) was a 20-game winner two years ago, but missed most of last season with a torn left Achilles. He is rediscovering his form now, lowering his ERA to 4.49.
''He's been a master craftsman for years,'' Pirates manager Clint Hurdle. ''He was on top of his game.''
Stephen Piscotty hit a three-run home run and Randal Grichuk also went deep for St. Louis, which reclaimed second place in the NL Central by a half-game over Pittsburgh to end a rough 4-5 homestand. All-Star Matt Carpenter (oblique) joined Brandon Moss (ankle) and Brayan Pena (knee) on the 15-day disabled list earlier in the day.
''We heard the news, then we went about our business,'' Piscotty said. ''We have to stay the course. I don't think anyone's going to give up by any means.''
Piscotty's 11th homer off Arquimedes Caminero was initially ruled off the top of the center-field wall but the call was overturned after review. Piscotty had three homers during the home stand but didn't think this one was out.
Tyler Glasnow (0-1) was charged with four runs in 5 1/3 innings in his debut. The 22-year-old right-hander was the 11th starter used by the Pirates and, like Steven Brault earlier in the series, got his first career hit.
''It was kind of crazy waking up and coming to the ballpark and I really think I took it all in,'' the 6-foot-8 Glasnow said. ''It was a fun experience.''
Hurdle was impressed.
''He commanded the zone, he made his pitches,'' the manager said. ''He didn't let things get out of hand at any point in time.''
Jordy Mercer doubled and had an RBI for the Pirates, who had come from behind to win the previous six games. They haven't swept a four-game series in St. Louis since 1997 and the Cardinals haven't been swept in four games at home by anyone since Colorado in 2009.
Aledmys Diaz, named an All-Star earlier in the day to replace Carpenter, tripled off the top of the left-field fence and scored on a wild pitch to tie it in the fourth. Grichuk's first homer since June 12 gave the Cardinals the lead for good in the fifth.
Wainwright matched his season best with nine strikeouts and got his 129th career win, passing Harry Brecheen for seventh on the franchise list. He's permitted one run over 14 innings his last two outings.
''The way the first month and a half went for me was a real grind but I knew I was going to turn it around,'' Wainwright said. ''And I'm on my way, I wanted that eighth win.''
The first pitch was delayed 31 minutes by rain. During the homestand there were 5 hours and 44 minutes of delays.
Pirates: RHP Gerrit Cole (triceps) is expected to make a second rehab start on Sunday.
Cardinals: 3B Jhonny Peralta (left thumb) missed his second straight start.
Cardinals 3B Greg Garcia made two nice grabs on liners, robbing Jung Ho Kang in the first and pinch-hitter Sean Rodriguez in the eighth. Garcia led off in place of Carpenter and had a double, walk and scored a run.
Pirates: Francisco Liriano (5-8, 5.34) snapped a five-game losing streak his last time out, but is 0-2 against the Cubs this year.
Cardinals: Michael Wacha (5-7, 4.38) has won three straight starts and faces the Brewers for the second straight time.