MIAMI - Long before the season began, as they constructed the team they hoped would bring postseason baseball back to Queens, the Mets envisioned a lineup based on depth.

They imagined grinding out at-bats, with the intent to wear down and eventually beat up pitchers. They hoped it would be a perfect complement to a dynamic young pitching staff.

Only now has that plan become a reality.

The revamped Mets won their sixth straight game Wednesday night, holding off the Marlins, 8-6, behind a suddenly surging offense that provided plenty of breathing room for a brilliant Matt Harvey.

The outburst gave the Mets just enough cushion to withstand a furious six-run rally in the ninth, which the Mets began leading 8-0. By the end, the Marlins had brought the winning run to the plate in Christian Yelich, who grounded out against closer Jeurys Familia.

Eric O'Flaherty was tagged for four runs one day after arriving in a trade with the A's. Hansel Robles was charged with two runs. Familia stepped in and allowed consecutive hits before getting Yelich to spare the Mets an epic meltdown.

Juan Uribe, acquired before the trade deadline, bashed a three-run shot in the fifth that buzzed the Clevelander nightclub beyond the leftfield fence at Marlins Park. His 10th homer came after a rally in the third, when Lucas Duda drove in two runs with a double into the gap in left-center.

Yoenis Cespedes had a run-scoring single, and rookie Michael Conforto tacked on a sacrifice fly to complete the Mets' four-run third.

Marlins starter David Phelps (4-8) offered little resistance. While he kept the Mets scoreless through two innings, his pitch count rose steadily, the product of a disciplined approach. He was knocked out by Uribe's homer with one out in the fifth, charged with seven runs.

By comparison, Harvey cruised, extending perhaps his most consistent run of the season. In a nod to their efforts to limit his innings in his first season back from Tommy John surgery, Terry Collins pulled him after seven shutout innings.

Under ordinary circumstances, he might have bid for a shutout. He allowed only two hits and threw just 88 pitches.

The Mets completed their first road sweep this season and stayed in first place in the NL East. They began the day with a one-game edge over the Nats.

The Mets arrived Monday to play a team that has long faded from contention. Collins worried about a letdown. After the emotions of a memorable homestand, he asked his veterans to reiterate the importance of these games. After three days, it was clear the Mets didn't need a reminder.

It wasn't that long ago that the Mets struggled to mount any sustained offense, thanks in part to injuries. For weeks, they had forced their starting pitchers to subsist on scraps. But on Wednesday night, they awarded Harvey (10-7, 2.76 ERA) with a bounty, building him a seven-run lead in five innings.

His 4.14 ERA against the Marlins had been his highest against any team he faced at least five times. But with Harvey displaying command of his fastball, that history looked irrelevant.

In his last nine starts dating to June 16, Harvey is 4-3 with a 1.64 ERA.