Giancarlo Stanton, the Marlins’ $325-million masher, has spent much of the season inspiring questions about his pedestrian production. But for one night, Stanton showcased his signature power, and the Mets paid a steep price.

In the Mets’ 5-2 loss to the Marlins on Tuesday night, Stanton homered twice, knocked in all of his team’s runs, and rushed in to make a sliding catch on Juan Lagares’ dying liner to rightfield. The seventh-inning grab squashed perhaps the Mets’ best chance to rally.

With that, the Marlins ended the Mets’ winning streak at five games and spoiled Jose Reyes’ first game back with the franchise that made him into a star. Leading off and starting at third base, Reyes finished 0-for-4 in his first big-league game since the Oct. 31 domestic-violence arrest that effectively ended his tenure with the Rockies. He was suspended 52 games, and it paved his path for a controversial homecoming.

Yoenis Cespedes blasted a solo shot — his 21st homer of the season — and reached base three times. His outburst came on the same day he was named an NL All-Star, along with closer Jeurys Familia and Noah Syndergaard.

Alejandro De Aza blasted a pinch-hit homer in the eighth to cut the deficit to three, though it wasn’t enough.

Nor was Steven Matz’s best start in more than a month.

The Long Island native allowed two runs on six hits in seven innings. Mostly, he worked quickly and cruised, striking out six while walking just one. But his biggest mistake came back to bite him.

Stanton lashed a two-run in the seventh inning. The low liner marred what was perhaps Matz’s best outing since revealing that he’s been pitching through a painful bone spur.

Stanton wasn’t done. He blew open the game in the eighth. With the Mets trailing 2-1, reliever Erik Goeddel paid the price for falling behind in the count. He grooved a 3-and-1 fastball over the plate, leaving it for Stanton to bash a three-run homer into the upper deck in leftfield.

For the first time all season, Stanton logged a multi-homer game, leaving the Mets (45-38) needing a victory in Wednesday’s rubber game to collect another series win.

The Mets had outscored their opponents 40-17 in their five gams. But they couldn’t touch Marlins lefty Wei-Yin Chen, who entered play with a 5.11 ERA.

Chen gave up Cespedes’ solo blast but nothing else in seven innings.

The stalled offense wasted a strong outing by Matz, whose ability to take the mound remains a start-to-start determination by both himself and the team. All of it hinges on how he deals with the pain that comes of a bone spur digging into the nerves in his left elbow.

Thus far, he has been fervent in his desire to stay in the rotation, despite pain that has impacted how he prepares for starts and which pitches he can throw once he takes the mound.

His slider makes only occasional appearances, for throwing it takes a toll. The bone spur is large enough that it will ultimately send Matz to the surgeon’s table. But he’s not ready to allow that day to come — at least not during the season.

So Matz trudged on, even though he remains winless since May 25. Until Tuesday night, he hadn’t logged seven innings in a start since his last win. He needed just 72 pitches to log six shutout frames. But the seventh brought trouble.

And one day after crawling back from a 6-0 deficit against the Marlins, the Mets did not have another comeback in them.