BALTIMORE — The Yankees captured the game Brett Gardner a night before called, in a bit of hyperbole, a “must-win.”

There are none of those, of course, in early May, but the Yankees certainly were in desperate need of a course correction.

For one night, they got it.

Behind a turn-back-the-clock performance from CC Sabathia and a three-run sixth inning that snapped a scoreless tie Wednesday night, the Yankees broke a six-game losing streak with a 7-0 victory over the Orioles in front of 15,998 at Camden Yards.

“After the game, it felt like we clinched a playoff spot or something,” Gardner said, only half joking, as his club improved to 9-16.

That Gardner could manage a smile was not insignificant. He was hit in the right elbow with a pitch during a four-run eighth that made it 7-0 and though he stayed in the game, Gardner came out in the ninth. X-rays taken on the elbow were negative but Joe Girardi said, “I have my concerns for the next couple days because of where he got hit.”

advertisement | advertise on newsday

“We’ll have to wait and see how he feels tomorrow,” Girardi added.

Sabathia, who came in 1-2 with a 5.06 ERA, threw goose egg after goose egg over a season-high seven innings.

The 35-year-old lefthander, keeping the Orioles (15-11) off balance with a precise fastball and terrific offspeed pitches, especially his changeup, struck out six and walked two.

The significance of Sabathia accomplishing such a start in this ballpark wasn’t lost on anyone, least of all the lefthander. It was here early last October when, after a weekend bender, Sabathia went into Girardi’s office and said he needed help. He entered alcohol rehab a day later, on Oct. 5.

“It’s a big contrast from me standing in this locker room the last time,” he said. “So to be able to go out and get us a win, it felt great.”

Yankees videos

Brian McCann didn’t want to hear anything about Sabathia being a former ace.

“He is as good as they come,” McCann said. “He’s such a competitor, he’s going to find a way. We want him on the mound.”

The Yankees entered the night tied for last in the AL in runs (82) and had just one hit over the first five innings against Baltimore righthander Tyler Wilson. But they erupted for three runs in the sixth against Wilson, 1-0, 3.06 coming in, to take a 3-0 lead and put up four more in the eighth against lefthander T.J. McFarland and Dylan Bundy to make it 7-0.

The Orioles went 1-for-8 with runners in scoring position against Sabathia and stranded five.

“Just a brilliant performance,” Girardi said of Sabathia. “It meant a lot for this club.”

advertisement | advertise on newsday

Baltimore loaded the bases with one out in the eighth against Kirby Yates but Dellin Betances, who has struggled of late, came on to strike out Chris Davis and get Mark Trumbo, who homered twice on Tuesday, to pop out. Betances had allowed a home run in each of his previous three outings, but putting those kinds of outings quickly in the past is something he learned from former Yankee closers Mariano Rivera and David Robertson.

“In this game you have to be able to turn the page,” Betances said. “A short memory is the key. Something I learned from Mo and Robertson. That’s what I try to do.”

McCann had two hits and three RBIs to lead the Yankees’ offense. Leadoff man Jacoby Ellsbury added three hits and two walks, reaching base all five times he was up, and Mark Teixeira reached base four times — walking three times — and scoring two runs.

“Show up tomorrow and do the same thing,” McCann said of the outburst. “Hasn’t been from a lack of effort. We just haven’t been squaring the balls up when we needed to, haven’t been getting the timely hits. Hopefully this is a step in the right direction.”