Getting your Trinity Audio player ready...

Kyle Stowers homered and the Miami Marlins denied the Chicago Cubs a chance to clinch a playoff berth for the second straight night with a 3-2 victory Wednesday at Wrigley Field.

Dansby Swanson drove in both runs for the Cubs, who needed a win over the Marlins or the Arizona Diamondbacks to lose to the Colorado Rockies to secure an NL wild-card berth.

Joe Mack’s groundout brought home Augustin Ramirez with the go-ahead run in the seventh and the Marlins retired the next nine Cubs batters to win their second straight game after dropping three to the San Diego Padres.

Photos: Miami Marlins 3, Chicago Cubs 2

Stowers hit his 21st home run, a two-run shot, off Kevin Gausman in the top of the sixth to break a scoreless tie. The Cubs evened things in the bottom of the inning when Swanson laced a broken-bat single into left field to bring home a pair of runs.

Cade Gibson (6-2), the second of four Marlins relievers, struck out two in the seventh and Sandy Alcantara worked the ninth for his second save.

Reliever Ryan Rolison (9-2) took the loss.

Gausman struck out seven and allowed two runs, six hits and a walk in the first 5 2/3 innings. The Marlins’ Ryan Gusto allowed six hits and two walks while striking out five in 5 1/3 innings.

Pete Crow-Armstrong needed a stolen base to become the seventh player to join the MLB 40-40 club but went 0 for 3 with a walk and remained at 45 home runs and 39 steals.

Up next

The Cubs will start LHP Matthew Boyd (9-5, 4.06 ERA) for Thursday afternoon’s regular-season home finale. RHP Tyler Phillips (5-6, 3.45 ERA) is scheduled to start for the Marlins.