BALTIMORE — Joe Girardi laid it out for his club the night before.

The Yankees’ manager rarely applies pressure to his players in public, but there he was late Saturday night after a second straight shutout loss to the Orioles calling Sunday afternoon “probably the most important” game of the season.

It did not produce an offensive outburst from his rejiggered lineup, which featured five rookies, or lights-out starting pitching by Michael Pineda. But with just enough offense, some game-saving middle-relief work by Luis Severino and a four-out save by Dellin Betances, the Yankees beat the Orioles, 5-2, in front of 31,161 at Camden Yards for the victory Girardi felt they had to have.

“It keeps us alive,” he said.

The Yankees (70-65), who avoided a three-game sweep and completed their six-game trip with a 3-3 record, are 3 ½ games behind the Orioles and Tigers (both 74-62) for the American League’s second wild-card spot. They will begin a three-game series against the first-place Blue Jays on Monday afternoon, the start of a 10-game homestand.

advertisement | advertise on newsday

“When they win the first two, you can survive if you win the third one,” said Chase Headley, who drove in two runs with a pair of two-out singles. “But if you drop all three, it’s going to make it really tough. It was important for us to get this one.”

But even with the Yankees scoring three times with two outs in the first, highlighted by Headley’s bloop RBI single to leftfield and Austin Romine’s two-run single through the hole into left, and making it 4-0 on Headley’s infield single in the third, Severino’s two-inning performance stood out.

As Romine, who caught Severino plenty when the two were in the minors together, put it: “You can go into mindsets and whatever, I don’t know, I’m not a pitching coach. All I know is when he comes out of the pen, it’s really good stuff.”

The 23-year-old Severino, who never got things going this year as a Yankees starter and spent the majority of the season in the minors, replaced Pineda (two runs, five hits and two walks in four innings-plus) with none out in the fifth after Pedro Alvarez’s opposite-field RBI double made it 4-2.

After a wild pitch moved Alvarez to third, Severino had to face Manny Machado, Mark Trumbo and Chris Davis, who have hit 107 home runs between them this season. He struck out Machado on a slider, and after walking Trumbo and Davis to load the bases, he struck out Steve Pearce with a 97-mph fastball and got Matt Wieters to ground to second for the third out.

Yankees videos

Fully settled in, Severino, throwing strictly fastballs and sliders in the outing, pitched a perfect sixth. He combined with Tommy Layne, Adam Warren, Tyler Clippard and Betances to pitch five one-hit shutout innings.

“Starter or reliever, I just want to do my job,” said Severino (2-8), who shined as a starter last August after being inserted into the heat of a playoff race and would prefer to make that his career role. “Every time they give me an opportunity, I try to do my best. I feel good, I feel comfortable. I feel all my pitches are working.”

Girardi said if Severino had not pitched Sunday, he likely would have started in place of injured Chad Green on Wednesday. That start could go to Bryan Mitchell or could be, Girardi said, “a bullpen day.”

After Trumbo dropped Tyler Austin’s fly ball to rightfield for a two-base error in the ninth, Ronald Torreyes bunted him to third and Brett Gardner had an outstanding plate appearance against sidearming lefthander Donnie Hart, delivering a sacrifice fly to right for a 5-2 lead. Betances then struck out two in a perfect ninth for his eighth save.

“You can’t afford to lose three in a row to these guys,” Girardi said. “To be able to bounce back today was important.”

advertisement | advertise on newsday

advertisement | advertise on newsday