The Cincinnati Reds also clinched at least a wild-card berth, when they beat the New York Mets 3-2 in 10 innings. The Pirates and Reds, both 90-67, trail St. Louis by two games in the NL Central with five to go.
Pittsburgh players sang Journey's "Don't Stop Believing." They took pictures and manager Clint Hurdle had them gather for a group photo in the middle of the cramped visitors' clubhouse.
"The people of Pittsburgh have been waiting a long time," said Neil Walker, who homered.
The Pirates snapped a 1-all tie when Marte sent a drive off Kevin Gregg (2-6) with two outs in the ninth into the left field bleachers.
In a fitting coincidence, they then preserved the victory on the final out in a play at the plate.
McCutchen, the center fielder, picked up Ryan Sweeney's bloop single after right fielder Marlon Byrd failed in trying to scoop up the ball and threw to first baseman Justin Morneau, positioned just in front of the pitcher's mound. Morneau caught the throw on one hop and made the relay to catcher Russell Martin, who applied the tag on Nate Schierholtz trying to score from first base.
Still on his knees, Martin held the ball over his head in jubilation. Then, he heaved the ball toward deep left field as the Pirates celebrated near the mound, and Jason Grilli grabbed him, having escaped with his 32nd save in 34 chances.
"Twenty-one years since we popped champagne in a Pirates clubhouse — and we're acting like it's been a long time," Hurdle said. "The hard work, the fun. I'm just proud of each and every man in here, the fans they represent, ownership, general manager, president ... the scouts, players. This has been a group effort for a long time."