Dellin Betances had heard a chorus of boos during his most recent appearance at Yankee Stadium, a hapless outing in which he walked four of five batters to force home the go-ahead run in Wednesday’s one-run loss to the Blue Jays.

That erratic display punctuated nearly two weeks’ worth of struggles. Entering play Saturday afternoon against the Brewers at Yankee Stadium, he had seen his ERA rise from 0.40 on June 21 to 3.29. In his last five appearances, he had walked 11 batters in three innings and surrendered seven runs.

At least for now, though, Betances seems to have put those struggles behind him. With the Yankees trailing by a run, he struck out two in a perfect eighth inning to help set up Clint Frazier’s walk-off three-run home run in a 5-3 win.

Betances threw nine of his 11 pitches for strikes, getting Travis Shaw and Domingo Santana swinging to end the inning.

“I have confidence in myself,” said Betances, an All-Star for the fourth consecutive season despite his recent control problems. “Obviously, things haven’t been going as well, but I believe in myself every time I go out there. You have to move on from the bad and the good; you just have to be able to turn the page.”

Betances received help from first baseman Ji-Man Choi. Betances’ 0-and-2 pitch to Ryan Braun was scorched to the right side of the infield, and Choi, playing far off the bag because of the shift, dived to his right and tossed to Betances for the out at first.

“I thought both my fastball and breaking ball were good, but I think it started with Choi making a really good play at first,” Betances said. “From there, I was able to attack the strike zone with both pitches.”

advertisement | advertise on newsday

Aroldis Chapman struck out the side in the ninth and earned the win. While he hasn’t been nearly as inconsistent as Betances, the lefthander had been scored upon in three of his last five appearances entering Saturday’s game.

“We feed off that. When they’re in there and dominating hitters, we feed off that energy,” Aaron Judge said. “They had their stuff today, and that’s kind of what got us going.”

With bullpen disasters becoming something of a trend for the Yankees, they reversed course and relied on the bullpen in a close game.

Joe Girardi, perhaps stating the obvious, said Betances and Chapman are integral pieces moving forward.

“I’ve said it all along, these guys are extremely talented and they’re extremely important to us,” he said. “So getting them on track is vital to our success. It’s good to see what Dellin did today, the strikes he threw, the quality strikes he threw. Let’s build on it.”