"You hit one, you're lucky," Martinez said of Gant's second blast of the season. "You hit a second one, you're a power hitter."
The Cardinals have won 17 of 21 and took their tenth consecutive series, their longest series winning streak since 2009, when they also won ten in a row.
"It's an important thing," Cardinals manager Mike Shildt said. "We want to get better as the game goes and we want to get better as the series goes. And if you take care of the series, the rest of it just falls into place."
Gant (6-5) pitched out of a bases-loaded situation in the first and a two-on, no-out jam in the third to win for the third time in his last four tries. He struck out six in 5 2/3 innings and has allowed one earned run in his last 12 2/3 innings.
"It was a great team win, a great series win," Gant said. "Another series win, and we're going to try to keep on chugging."
Pirates starter Joe Musgrove (5-8) opened the game with 21 consecutive strikes, a first in the majors since pitch tracking began in 1988, according to Stats. That control didn't do him much good, though. He gave up five runs in six innings.
"I came out sharp but I didn't keep my foot on the gas," Musgrove said. "I didn't keep going. That's got to be done against a good lineup like that."
Musgrove's strike streak ended with a first-pitch ball to Bader in the third, and two pitches later, Bader went deep to left. Gant then homered on a 2-1 pitch, giving St. Louis consecutive home runs for the seventh time this season.
"I'm just trying to make contact and contact was made tonight," Gant said.
Gant tied Miles Mikolas for most home runs among St. Louis pitchers this season. After starting his career 0 for 30, Gant has homered twice in his last six at-bats. He is the third pitcher in the expansion era to have his first two career hits as home runs.
Shildt said Gant put in a gutty performance.
"He was making pitches," Shildt said. "He missed a few spots and the guys made some plays, but John's a really good competitor, he's a mentally tough guy, so he was really just able to compete with what he had and used all his pitches."
Martinez singled and scored in the fourth and drove in two more with a single in the fifth to give the Cardinals a 5-0 lead. Martinez has hit safely in 20 of 25 games in August and has a team-high 18 multi-RBI games.
"He was actually trying to mix in some pitches and he was throwing some different pitches than we were expecting," Martinez said of Musgrove. "We just had to make the adjustments."
Pittsburgh lost for the seventh time in its last nine games. The Pirates stranded 12 runners and went 0 for 9 with runners in scoring position.
"There was hard contact," Pirates manager Clint Hurdle said. "It's not fair. There's times when it's not fair. You hit hard balls, you hit them right at people but you've just got to play man."
FACE IN THE CROWD
St. Louis Blues star Vladimir Tarasenko signed autographs on the field before the game.
Cardinals: OF Marcell Ozuna (right shoulder inflammation) took batting practice Thursday and is on track to return from the 10-day disabled list when eligible on Sept. 1.
Pirates: RHP Jameson Taillon (10-9, 3.49 ERA) kicks off a three-game series on the road against the Atlanta Braves and RHP Anibal Sanchez (6-5, 3.05 ERA). Taillon has allowed three earned runs or fewer in his last 16 starts.
Cardinals: LHP Austin Gomber (4-0, 2.79 ERA) will open a three-game home series Friday night against the Cincinnati Reds and RHP Homer Bailey (1-12, 6.17 ERA). The Cardinals are 6-0 when Gomber starts.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
MLB postponements timeline: How positive coronavirus tests have impacted the schedule
It didn't take long for the reality of the pandemic to reshuffle the restart of the 2020 baseball season. Here's a look at the past week.
Fantasy baseball forecaster for Week 3: Aug. 10-16
Set your lineups for the week ahead in fantasy baseball with our forecaster preview, which features pitcher rankings, two-start pitchers, hitter ratings, schedule observations and more.
Margevicius to make first start for Mariners vs. Rockies
Nick Margevicius had pitched in just one game above the Single-A level when, at age 22, he joined the San Diego Padres' rotation last season.
Padres host Diamondbacks as big decision looms
Usually when Chris Paddack starts for the Padres, he is the No. 1 story.
From Olympic medalist to MLB infielder: How speedskater Eddy Alvarez made it to The Show
Six years after winning silver at the Sochi Games, the 30-year-old Miami native made his major league debut with his hometown team. 'It's OK to dream,' Alvarez says.
Dodgers' Kershaw to make delayed start vs. Giants
It took more than two weeks, but the San Francisco Giants and Los Angeles Dodgers finally will offer the matchup that was expected when the season began on July 23.