MIAMI - Dee Gordon tripled to lead off the 10th inning and scored on a walk-off base hit by Justin Bour to lift the Miami Marlins to a come-from-behind 5-4 win over the Boston Red Sox on Tuesday night.

The Red Sox led 4-0 in the sixth inning before the Marlins climbed back into the game with two runs in the sixth, one in the seventh and one in the ninth before Bour's heroics in the 10th.

Gordon lined a triple to left-centre field off Craig Breslow (0-2) as centre fielder Mookie Betts's dive was unsuccessful. Breslow intentionally walked Martin Prado and struck out Derek Dietrich before Bour lined a base hit to left-centre, ending the game.

Bryan Morris (4-3) earned the victory with a scoreless 10th.

Five Marlins relievers combined to retire the final 13 Boston hitters.

Miami left 16 men on base and were 4 for 16 with runners in scoring position.

Adeiny Hechavarria sent the game to extra innings with a sacrifice fly in the bottom of the ninth inning off Junichi Tazawa.

The Marlins trailed 4-3 in the ninth as J.T. Realmuto and Ichiro Suzuki each singled off Tazawa, whose wild pitch in the dirt advanced the runners to second and third. Realmuto scored on Hechavarria's deep fly ball.

Boston knuckleballer Steven Wright allowed two runs and five hits in five-plus innings. He struck out four and walked five.

Wright exited in the sixth with a 4-0 lead after allowing the first two batters to reach base.

Ryan Cook relieved Wright and pinch-hitter Casey McGehee drove in a run with a groundout and Gordon's RBI single cut the Marlins' deficit to 4-2.

Miami loaded the bases in the seventh with no outs, but only managed to score one run when Suzuki hit a sacrifice fly to pull the Marlins within 4-3.

Marlins starter Justin Nicolino allowed nine hits and four runs in 5 2-3 innings.

Betts had an RBI single in the third to score Bradley, who reached on a triple. Betts also had an RBI double in the fifth, which also plated Bradley for a 2-0 lead.

The Red Sox scored two runs in the sixth inning on a wild pitch by Nicolino and an RBI triple by Rusney Castillo, which ended Nicolino's outing.

TRAINER'S ROOM

Red Sox: LF Hanley Ramirez (toe) missed his third consecutive game, but manager John Farrell is hopeful Ramirez will return on Wednesday.

Marlins: RHP Jose Fernandez (right biceps strain) was placed on the 15-day disabled list retroactive to Aug. 8. ... OF Christian Yelich (right knee contusion) was scratched from the lineup, snapping a streak of starting 39 consecutive games.

NEXT UP

Red Sox: LHP Eduardo Rodriguez (6-4, 4.17 ERA) takes the mound in the second game of a two-game series against the Marlins. Rodriguez has a 1-1 record and 2.84 ERA in his last three starts.

Marlins: LHP Adam Conley (1-0, 4.05) will make his second start of the season after allowing two runs in five innings in a 14-3 win against Cincinnati on July 11.