"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
How the Phillies can be smart spending stupid amounts of money
The Phillies have plenty of payroll space and expectations of contention to deliver on. Here's a plan for which top free agents they should target.
Buster's Buzz: A checkup on the state of baseball
A new TV deal and strong attendance don't jibe with complaints about the changing game. What are the strongest indicators of the sport's health?
Astros acquire Aledmys Diaz in trade with Blue Jays
The Astros, who could lose Marwin Gonzalez to free agency, acquired infielder Aledmys Diaz, who hit a career-high 18 homers last season, in a trade with the Blue Jays.
Dodgers closer Kenley Jansen set for Nov. 26 heart surgery
Dodgers closer Kenley Jansen is expected to be ready for spring training after surgery to correct his irregular heartbeat. The surgery, which had been expected, has been scheduled for Nov. 26, with recovery time anywhere from two weeks to eight weeks.
Red Sox re-sign Series MVP Steve Pearce on 1-year, $6.25M deal
World Series hero Steve Pearce will be back in a Red Sox uniform in 2019. Boston re-signed the journeyman 1B for a reported $6.25 million. "We all saw what kind of impact he can have," GM Dave Dombrowski said of the improbable World Series MVP.
Rangers hire Julio Rangel to handle pitching staff
Julio Rangel has been hired by the Texas Rangers as pitching coach for new manager Chris Woodward.