PITTSBURGH -- Pittsburgh Pirates general manager Neal Huntington spent the hours leading up to the non-waiver trade deadline searching for a way to upgrade the team with the best record in baseball.
The typically buttoned down Huntington even considered taking leave of his senses to do it.
"We talk a lot about, we don't want to do something stupid," Huntington said Wednesday after the deadline passed. "We were willing to do something stupid. We just didn't want to do anything insane."
At the moment, insanity might be defined as breaking up the chemistry the Pirates have spent the last four months cultivating.
Martin's sharp grounder off Trevor Rosenthal (1-2) rolled into left field, giving Walker time to score from second and propel Pittsburgh to its 25th comeback win in an increasingly special season. Pittsburgh is 23 games over .500 for the first time since 1992.
"We can win just about every way possible," manager Clint Hurdle said.
The Cardinals appeared in firm control of the division race two weeks ago but now find themselves staring up at the Pirates, who have taken the first four games of a five-game series.
St. Louis broke out of a slump to put together 13 hits, but the Cardinals left 11 runners on base and dropped their seventh straight. The Cardinals led 2-0, 3-1 and 4-2 but couldn't hold on.
"You always at some point during the season, every year, no matter what, go through a rough patch," St. Louis starter Adam Wainwright said after failing to earn his 14th victory. "The good teams find a way to get out of that rough patch and find a way to get back to playing good quality baseball, and that's what we're going to do."
Tony Watson (3-1) worked two shutout innings in relief of starter Jeff Locke. Mark Melancon pitched a perfect ninth for his fifth save. Melancon is 3 for 3 in save opportunities since All-Star closer Jason Grilli went down with a right forearm injury last week.
Matt Holliday had three hits and drove in two runs but St. Louis failed to score over the final five innings against Pittsburgh's bullpen.
"There's something we're not doing, and we know we're not doing it and fixing it," Cardinals manager Mike Matheny said.
Walker hit his seventh homer of the season off Wainwright in the first inning, starting a pattern that repeated itself throughout the night. The Cardinals found ways to score off Locke, but Pittsburgh kept chipping away.
"It's things we've done throughout the course of the season," Pittsburgh center fielder Andrew McCutchen said. "If we're down early, we just keep working."
The teams with the two best records in the National League were mostly spectators before Wednesday's non-waiver trade deadline, though the Pirates acquired minor leaguer Robert Andino from Seattle.
The past two seasons, the Pirates made somewhat aggressive moves meant to bolster their playoff chances, but instead contributed in part to a second-half swoon.
This time, Huntington is keeping the group he called "one of the tightest" he's been around intact. When the 4 p.m. deadline passed, the Pirates were huddled around a TV in the clubhouse. They weren't anxiously waiting for news. Instead, they were watching Martin and first baseman Garrett Jones play video games.
"The trade deadline is like a gossip magazine," Watson said. "You take it for what it's worth but it's in one ear and out the other."
Pittsburgh needed to find a way after a rare off-night by Locke, whose rapid ascension from fifth starter to All-Star has fueled Pittsburgh's relentless pursuit of the Cardinals. But St. Louis spent four innings pecking away at the left-hander's usually deft mix of breaking balls.
The Cardinals came in hitting just .155 (30-194) during their late-July swoon but peppered Locke for 10 hits, the most he has given up in 31 career starts.
They came in various ways, from a hard-hit double by Beltran in the fourth to a swinging bunt by David Descalso that traveled 20 feet. Locke tied a season high by giving up four runs. He struck out six and walked one as his ERA rose from 2.15 to 2.36.
"He was fighting uphill all night," Hurdle said.
Wainwright, however, couldn't take advantage of the first signs of life by the St. Louis offense in a week. Every time the Cardinals would push in front, the Pirates would respond, eventually tying it on a sacrifice fly by McCutchen in the fifth. Wainwright left after seven innings, allowing four runs on eight hits, striking out six and walking one.
"(They) gave me the lead three times and I blew the save three times," Wainwright said. "I can be better than that, I will be better than that."
The Pirates placed reserve C Michael McKenry on the 15-day disabled after he underwent surgery on Tuesday to repair a torn meniscus in his left knee. Rookie Tony Sanchez, Pittsburgh's top pick in the 2009 draft, will serve as the primary backup to Martin for the rest of the season ... The series concludes Thursday with Pittsburgh's Charlie Morton (3-2, 3.59 ERA) facing Joe Kelly (1-3 3.44). The Pirates are 5-1 in Morton's last six starts.
Could David Ortiz' endorsement get Barry Bonds, Roger Clemens into the Hall of Fame?
With Bonds and Clemens shut out again, their fates are in the committees' hands. Could a seal of approval from David Ortiz be the difference-maker?
Cleveland Guardians sign agreement to extend lease at Progressive Field through 2036
The Guardians have reached an agreement to extend the lease at their downtown ballpark through at least 2036 while making improvements to the facility.
Gene Clines, World Series winner and part of MLB's 1st all-minority lineup, dies at 75
Gene Clines, part of the first all-minority lineup in MLB history and a line-drive-hitting outfielder for the 1971 World Series champion Pirates, died Thursday. He was 75.
MLB won't require minor league players to be vaccinated against COVID-19
Major League Baseball will not require minor league players to be vaccinated against COVID-19 to play in 2022 but will mandate on-field staff working with players be "up to date" on vaccinations.
Minor league players committee raises concerns on possible loopholes in housing plan
Minor leaguers are identifying red flags in how Major League Baseball could implement its plan to house players that might allow teams to "cut costs rather than providing proper housing."
Ichiro unanimous? A wait for Chase Utley? Predicting the next three Baseball Hall of Fame classes
This year's Baseball Hall of Fame ballot produced only a single inductee. Will the next three have the same result?