Panic may not have reached The Bronx after two losses to the Red Sox to open the season, but it wasn’t far away.

“It’s a pretty important game for us tonight,” Joe Girardi said before the Yankees hosted the Red Sox. “It’s not do-or-die for us, but it is important.”

And just like so many times before, the Yankees were able to rely on Andy Pettitte and Mariano Rivera in a 4-2 win over the Red Sox, to avoid an 0-3 start.

The two veterans, both north of 40, didn’t just get the Yankees their first win, they helped save a bullpen that had been taxed in the first two games after CC Sabathia and Hiroki Kuroda lasted a combined 6 1/3 innings.

Pettitte didn’t give up a run until the seventh and Rivera, pitching for the first time since tearing the ACL in his right knee shagging fly balls in Kansas City on May 3, picked up the save — striking out Jackie Bradley, Jr. to end it.

“Our season wouldn’t be over if we lost this game, but you don’t want to get swept at home to start the season,” said Pettitte, who lasted eight innings on another cold night at Yankee Stadium. “You just want to get that win. We’ve got so many new guys and you just want guys to get comfortable.”

Having Pettitte and Rivera on the mound no doubt helps that process.

“It’s a lot of emotions there,” said Rivera, who walked Dustin Pedroia to start the ninth and surrendered a run on a Jonny Gomes’ double. “But at the same time, you have to control that. I have to be able to do that. We still have to finish the game.”

The duo made things easy for the patchwork offense, which had Robinson Cano hitting second for the first time since 2010.