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
NL East Stock Watch: Which team is having the best winter?
The division's four contenders have made the biggest moves to restock their rosters, but they're far from finished.
How baseball shaped the career of Patrick Mahomes
Chiefs QB Patrick Mahomes and former MLB superstar Alex Rodriguez each tell the story of their relationship and how Mahomes came to choose football.
Five teams ready to strike once Bryce and Manny sign elsewhere
There's more to the market than Bryce Harper and Manny Machado. These clubs could make major upgrades without landing the two biggest prizes.
'I think about his smile, his laugh': Roger Clemens reflects on Mel Stottlemyre
The late great Yankees pitcher and coach battled cancer for decades, but never let on that he was sick.
Former MLB pitcher John Wetteland arrested on child sexual abuse charge
John Wetteland, who pitched for four teams over 12 major league seasons, has been arrested on a charge of sexual abuse of a child under the age of 14, according to police records.
Schefter: Murray will go in 1st round
Adam Schefter joins SportsCenter to analyze Kyler Murray's decision to declare for the NFL draft.