ST. LOUIS -- Trevor Williams figured he might be in for a long night.
The Pittsburgh Pirates' right-hander surrendered a walk and a double to the first two St. Louis hitters he faced Wednesday.
"It was a little terrifying," Williams admitted.
The hottest pitcher in the National League had no reason to worry.
Williams (11-9) gave up three hits while striking out a career-high eight- all swinging.
"He did a great job hitting the corners," St. Louis shortstop Paul DeJong said. "His ball was moving a lot of different ways."
Williams has allowed just four earned runs over his last eight starts and improved to 5-2 with an 0.75 ERA during that stretch. He has a major-league best eight starts of at least five innings without allowing a run.
"He had to roll up his sleeves in that first inning," Pittsburgh manager Clint Hurdle said. "He doesn't get mauled at the plate and he's tough to square up. His fastball was especially effective tonight."
Williams got out of the early jam with two strikeouts and a nifty over-the-shoulder catch by second baseman Adam Frazier.
"He doesn't make that play, you never know what happens after that," Williams said. "We were just executing pitches from there on."
Marte lifted a bloop single to left field off Miles Mikolas (13-4) to bring in Jordy Mercer with the first run. Gregory Polanco followed with a run-scoring single to help Pittsburgh win for just the second time in eight games.
"We got some hits, got some action in that inning," Hurdle said.
Polanco, Frazier, and Corey Dickerson had two hits each for the Pirates.
The Cardinals, who dropped to 16-4 in their last 20, are now 4 1/2 games behind first-place Chicago in the NL Central. They hold the first wild card spot and have a half-game lead over Milwaukee.
St. Louis fell to 27-13 under manager Mike Shildt, who took over for Mike Matheny on July 15. Shildt was rewarded with a two-year contract on Tuesday.
Mikolas gave up two runs and eight hits over five innings. He struck out five and walked one.
"I think out of a couple hits they got, they hit one or two hard," Mikolas said. "I don't want to say I'm a victim of bad luck, but a couple of those, a couple of feet this way or that way, I don't think they're scoring at all."
The Pirates are 12-19 after winning 11 straight from July 11-24.
St. Louis infielder Matt Carpenter left the game in the fourth inning with a stomach ailment.
FIRST INNING SUCCESS
St. Louis starting pitchers have not allowed a run in the first inning of their last 11 games. Mikolas struck out Dickerson with the bases loaded to keep the streak alive.
Pirates: INF Jordy Mercer was activated from the 10-day disabled list prior to the game. He went on the DL with a left calf strain on Aug. 16. ... INF Sean Rodriguez has been designed for assignment. He hit .167 with five home runs and 19 RBI in 67 games this year.
Cardinals: INF Jedd Gyorko was placed on the 10-day disabled list with a left groin strain suffered in Tuesday's 5-2 win. OF Adolis Garcia was recalled from Triple-A Memphis. Garcia had 22 home runs and 71 RBI in 112 games with the Redbirds.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
Jose Peraza capitalized on Chase Anderson's home run troubles with a drive in the first inning and the Cincinnati Reds beat Milwaukee 3-1 Tuesday night, the Brewers' third loss in four games.
Jorge Alfaro hit a go-ahead, three-run homer in the sixth inning and the Philadelphia Phillies rallied past the New York Mets 5-2 on Tuesday night to boost their faint playoff hopes.
The Pirates win on a walk-off single up the middle by pinch hitter Ryan Lavarnway in the 11th inning.
The Yankees have issues with back-to-back double play opportunities to end the game, but finally succeed on the third try.
Stephen Strasburg matched his season-high with 11 strikeouts and Bryce Harper tied a career-high with five walks as the Washington Nationals beat the Miami Marlins 4-2 Tuesday night.
Mason Williams tracks down fly ball to make an incredible over-the-shoulder grab before hitting the wall.