The Yankees were unlucky to lose Andrew Miller to the disabled list after he had pitched as well as any closer in baseball. But they’re lucky to have an in-house replacement in Dellin Betances who has been even better.

With Miller not expected to throw for two weeks, Betances likely will move from the setup role into the closer’s job.

“That’s probably what I’ll look to do,’’ manager Joe Girardi said. “I’ll have to sit down with our coaching staff and obviously we’re going to have to bring a pitcher up to replace [Miller].’’

While Betances may be capable of filling Miller’s sizable shoes, he leaves some pretty big ones empty himself, that 1-2 punch a huge reason the Yankees find themselves atop the AL East.

“I feel good right now,” said Betances, who did not pitch in Wednesday’s 5-4, 11-inning loss to the Nationals. “I’ve just got to take that same mentality, what I’ve done in the eighth, just try to take it to the ninth. Same for the other guys. But I feel good. I’ll be ready to help the team.”

Miller — a perfect 17-for-17 in save opportunities — will be hard to replace. But Betances has been nearly unhittable, 4-0 with a microscopic 0.28 ERA and 54 strikeouts, the most of any reliever in the game. The question is if their dominant setup man replaces Miller, how can the Yankees replace him?

“That’s unfortunate. [Miller’s] been doing a great job,” Betances said. “We hate to lose one of our late-inning guys. But we’ve got to step up. Guys in the bullpen have got to step up and do our jobs until he gets back.

“Losing Miller is hard. He’s done a hell of a job. He’s probably done the best out of any closer probably in baseball right now. He’s converted every save he’s gotten a chance to, so it’s hard losing him. But we’ve got to step up. Every one of us has to look forward to the challenge and just try to get the job done.’’

Because of Betances’ past workload, the Yankees’ brutal upcoming schedule and concern he had overtaxed Miller, Girardi gave the right-hander Wednesday off. He turned to Jacob Lindgren instead with a 4-2 lead in the eighth, and the rookie couldn’t hold it, allowing a game-tying two-run homer.

Chris Capuano coughed up a run in the 11th to take the loss and snap the Yankees’ seven-game winning streak.

“It’s nice to have him to fill in, if you will,” Brett Gardner said of Betances. “But you can’t use him for the eighth and the ninth, so we’ve got to find somebody else to get the ball to him. We have to do our best without him.’’