Marte took Cubs closer Kevin Gregg deep, then Andrew McCutchen and Justin Morneau combined to throw out Nate Schierholtz at the plate for the final out of the game, assuring the Bucs of at least a wildcard spot.
Pittsburgh, who also got a homer from Neil Walker, booked a place in the post-season for the first time since 1992.
Cincinnati also sealed post-season play in dramatic fashion as Shin-Soo Choo's long RBI single in the 10th gave the Reds a 3-2 win over the New York Mets.
It was Choo's second RBI of the night on three hits for the Reds, who, tied for second in the National League Central with the Pirates, assured themselves of at least a wildcard berth thanks to Washington's defeat.
The Nationals lost 4-3 to the NL Central-leading St Louis Cardinals, who cut their magic number to four while eliminating Washington from the wildcard race.
Carlos Beltran smacked a two-run homer for the Cards, while Adam Wainwright struck out five in seven-plus innings.
Alex Rios hit for the cycle as the Texas Rangers gained ground in the American League wildcard race with a 12-0 demolition of the Houston Astros.
Rios hit a two-run double in the first, had an infield single in the third, homered in the fourth and tripled in the sixth, going four-for-four in total with four RBI and three runs scored.
Derek Holland struck out nine in a complete-game shut-out for his first win since August 4, helping the Rangers claw back half a game on the idle Cleveland Indians.
James Loney launched a pinch-hit walk-off home run as the Tampa Bay Rays established a one-game lead in the wildcard standings with a 5-4 win over Baltimore, but the match was marred by a nasty injury to the Orioles' Manny Machado.
The Detroit Tigers remained two games away from sealing the AL Central title as they lost 4-3 to the Minnesota Twins thanks to Josmil Pinto's 11th-inning walk-off single.
Marco Estrada hurled seven shut-out frames in the Milwaukee Brewers' 5-0 win over the Atlanta Braves, who maintained the National League's best record.
The Oakland Athletics moved to within a game of the Boston Red Sox in the race for the best record in the American League with a 10-5 win over the Los Angeles Angels.
The Miami Marlins beat the Philadelphia Phillies 4-0, the Chicago White Sox were 3-2 winners over the Toronto Blue Jays, the San Diego Padres overcame the Arizona Diamondbacks 4-1 and the Kansas City Royals beat the Seattle Mariners 6-5.