It was mission accomplished in Miami as the Mets took the rubber match against the Marlins heading into a three game series against the hapless Phillies at Citi Field.

Securing back-to-back victories may not be something to write home about, but it shows much improvement in a pitching rotation that looked like it was put out to pasture just a mere week ago.

Thursday night Seth Lugo gave the Mets a gift of five strong innings before running out of steam in the sixth. He allowed three runs, two earned, on six hits with three strikeouts and a walk.

Rene Rivera came to Lugo’s rescue with possibly the biggest play in the inning, gunning down Dee Gordon trying to steal second, reducing the potential damage when the righty surrendered three straight singles and a wild pitch.

Even though Lugo failed to finish seven innings since his season debut, he delivered a solid performance, backed by a stingy bullpen, and reliable offense by Jay Bruce (2 for 3) and T.J. Rivera (3 for 4), good for two RBIs a piece.

“The thing I would like to improve on is getting deeper in the game, getting to that seventh or eighth inning,” Lugo said.

With a 5-3 lead in the seventh, Matt Reynolds launched a leadoff triple, bringing in a crucial insurance run off of the fielder’s choice sharp ground out by Curtis Granderson.

Addison Reed made it interesting giving up a leadoff single to start the ninth before making minced meat out of Justin Bour and J.T. Realmuto with a pair of strikeouts, getting the final out on a Ichiro Suzuki grounder to third for his 12th save.

Friday the dominant Jacob deGrom will vie to extend his fortuitous run to four straight wins and keep the Mets pitching mojo rising against the Phillies.

This is a series the Mets can ill afford to lose if they have any chance of a resurrection with the National League East leading Nationals on deck later in the week.

“We’re hoping our pitching’s starting to fall into place right now,” Collins said Thursday’s win. “And if it does, we’ve got an exciting second half ahead of us.”