The St Louis Cardinals clinched the National League's final playoff spot despite losing on Tuesday after the Los Angeles Dodgers were officially eliminated from contention with a home defeat to the San Francisco Giants.
Over in the American League, the Oakland Athletics continued their improbable late-season surge by drawing level with Texas at the top of the AL West after a 3-1 triumph over the Rangers set up a division-deciding season finale between the teams.
Both have already secured post-season berths.
The Cardinals entered the penultimate day of the regular season needing a win or a Los Angeles defeat to claim the second NL wild card, and a 3-1 defeat to Cincinnati was rendered meaningless when the Dodgers were beaten 4-3 by the Giants.
The defending World Series champions will face fellow wild cards the Atlanta Braves in a one-game playoff as they return to the post-season despite key changes within the organization.
Former manager Tony La Russa retired following last year's championship while franchise player Albert Pujols joined the Los Angeles Angels.
The Dodgers (85-76) will miss the playoffs for a third straight year, a disappointing end to a campaign in which they strengthened their roster with a series of mid-season blockbuster trades.
In Oakland, starter Travis Blackley tossed six solid innings while his offense scratched out enough runs to seize their fifth straight win and put the Rangers (93-68) on the back foot.
Texas, the two-time defending AL Champions, have controlled the division since April but must now beat the Athletics (93-68) in the final game to avoid falling into a wild card spot.
In New York, the Yankees kept their noses in front in the American League East after Raul Ibanez smashed a two-run home run in the ninth inning to tie their game against Boston then delivered the game-winning RBI in the 12th.
"It was awesome to be a part of something like that," Ibanez told reporters after being mobbed by team mates. "To get an opportunity like that and to be able to help the team win, it's definitely special."
The 4-3 win kept New York (94-67) a game ahead of Baltimore going into the final game of the season and the Yankees will clinch the division with a win or an Orioles loss on Wednesday.
Baltimore (93-68) kept pace by shutting out Tampa Bay 1-0 despite a team-record 15 strikeouts from Rays pitcher James Shields.
Red-hot Chris Davis homered for the sixth consecutive game, his 33rd of the season, to provide the only run while Baltimore rookie pitcher Miguel Gonzalez threw 6 1/3 scoreless innings for the win.
In Kansas City, slugger Miguel Cabrera edged closer to securing a rare triple crown by going 2-for-3 with two RBIs in Detroit's 4-2 loss to the Royals.
The Tigers (87-74) clinched the AL Central on Monday but Cabrera's bid to become the first triple crown winner in 45 years will go down to the wire.
Cabrera raised his batting average to .331 to go with his other league-leading totals of 44 home runs and 139 RBIs.
"There won't be any debate if he wants to play (the last game)," Tigers manager Jim Leyland said. "If he wants to play, he'll play."
(Writing by Jahmal Corner in Los Angeles; Editing by John O'Brien)