Jeurys Familia and Jenrry Mejia were the biggest Royal Giants of them all on a day the Mets appeared ready for a leisurely cruise on the Allegheny River, only to hit resistance.

With the Mets wearing all-blue throwback uniforms Saturday to commemorate the Brooklyn Royal Giants of the Negro Leagues, Familia and Mejia combined for three perfect innings of relief in a 5-3 victory over the Pirates before 38,930 at PNC Park that snapped a three-game skid.

Familia retired all six batters he faced in the seventh and eighth innings before Mejia worked a perfect ninth, allowing Jon Niese to get the victory on a day when he didn’t have his best command.

In 13 appearances this month, Familia has allowed one earned run for a 0.69 ERA.

“When you think positive, positive things will come,” Familia said.

Mejia pitched two scoreless frames in the Mets’ 3-2 loss in 11 innings Friday night, but showed no signs of fatigue a day later, breezing through the ninth for his eighth save in nine chances.

“What we’ve got to do is get them the lead,” manager Terry Collins said. “Get the lead and let those two guys go out there and finish them off. They have been real impressive.”

Niese (5-4) was tested in running his streak to 20 straight starts of allowing three earned runs or fewer. The lefty lasted six innings and allowed three earned runs on seven hits with three walks and five strikeouts. After barely surviving the fourth and fifth innings, he needed only six pitches to get through the sixth.

The game stayed close after the Mets failed to build off the 5-0 lead they established through two innings. In both the fourth and seventh innings, the Mets put two runners on base, but couldn’t deliver a key hit.