MIAMI — Pete Alonso’s teammates emptied the kitchenette and waited by the entrance to the showers in the visitor’s clubhouse Monday night at Marlins Park.

Eggs, barbecue sauce, beer, shaving cream, ketchup, mustard, mayonnaise, all was slathered on the Mets’ rookie first baseman after he had hopped into a shopping cart that was pushed into the showers.

“My eyes were stinging really bad,” Alonso said. “I kept my mouth closed the entire time.”

Such was the celebration for Alonso smashing his first major league homer, a three-run blast in the ninth inning that delivered the knockout punch in a 7-3 victory over the Marlins.

In a wild final inning, the Mets scored four runs and then watched closer Edwin Diaz load the bases with nobody out in the bottom of the frame before striking out the final three batters.

Amed Rosario delivered the go-ahead RBI single, but Alonso, who is fast becoming the toast of the town, stole the show with a rocket that cleared the center-field fence and put an exclamation on the victory.

“That home run was one swing on my part, but we had a hell of an inning,” Alonso said. “Everyone was putting together really good at-bats ahead of me.”

Manager Mickey Callaway was asked why Alonso, who earned the job with his performance in spring training — after management chose not to manipulate his service time by keeping him in the minor leagues — has handled the transition to the major leagues so seamlessly.

“I think for the same reason everybody was wondering whether we were going to start him on the team or not: because he’s really friggin’ good,” Callaway said. “That’s something other teams probably weren’t willing to do. We understand that he’s one of our best players and wanted him on the team.”

Juan Lagares delivered a knuckle sandwich as part of the winning rally. Attempting to sacrifice bunt with two strikes in the ninth, Lagares appeared out on a foul ball, but plate umpire Sam Holbrook ruled the pitch had struck Lagares’ right hand.

Lagares remained in the game massaging the knuckle on his right index finger and Rosario delivered a go-ahead RBI single against Drew Steckinrider.

Not to be lost in the ninth-inning rally was Dominic Smith’s pinch-hit single against the shift. Lagares then came to the plate looking to bunt him to second and got drilled. Lagares received an X-ray that he said was negative.

“I was afraid, because that [pitch] was right at my face,” Lagares said. “Anything I could do at the moment just to protect my face.”

Diaz loaded the bases with nobody out in the ninth on two hits and a walk before striking out the next three batters. The victory was the Mets’ third in four games to begin the season.

Tim Peterson and Jeurys Familia combined for 2 ²/₃ innings of shutout relief behind Steven Matz, getting the game to the ninth at 3-3.

Matz was solid, allowing three runs — two of which were unearned — on six hits over 5 ¹/₃ innings. The left-hander threw only 74 pitches, pounding the strike zone to induce swings early in the count.

Lagares had homered against Marlins reliever Tyler Kinley leading off the seventh to tie it 3-3. It was a second straight big late-inning hit for Lagares, whose RBI single in Sunday’s eighth inning in Washington tied the game.

“We have to come out this series and play like they are the Nationals,” Callaway said of the underwhelming Marlins. “We can’t let up. These are the games, these are the series that mean just as much. You look up at the end of the year and you need to have taken care of business, whether it’s the Nationals or the Marlins. We have to take care of business and play the game the exact same way.”