Joe Girardi did everything he could to get the Yankees to Dellin Betances on Wednesday. Girardi took out his starting pitcher after four scoreless innings, nursed his bullpen through the next four, and then called on the big fella for the ninth.

The problem was the Yankees hadn’t scored. They were locked in a scoreless game with the Dodgers, the kind of game where one mistake can spell doom.

The Yankees made two. A pair of errors led to two unearned runs and a painful 2-0 loss before 30,254 at Yankee Stadium in a game that included a pair of rain delays totaling exactly one hour.

First, second baseman Starlin Castro missed Corey Seager’s inning-opening liner at his feet for an error. “I’m really disappointed in myself because that’s an easy play,” Castro said. “That’s a play that I can make and right now I feel bad for sure.”

After Seager stole second, Justin Turner doubled down the third-base line to drive in the first run of the game. Then, with Turner on third, Betances (3-5) air-mailed a throw home on a comebacker for an error as the Dodgers took a 2-0 lead.

“It just didn’t feel good out of my hand,” said Betances, who can throw a ball 100 miles per hour but has had trouble with short throws in the past. “I felt like I gripped it in the tip of my hand and the throw kind of sailed on me. I’ve got to be better.”

advertisement | advertise on newsday

The Yankees, who lost two of three to the first-place team in the NL West before a four-game series with the Red Sox at Fenway Park, were held to three hits by Clayton Kershaw and four relievers.

“Every loss is a tough one now,” Betances said. “Obviously, we’re trying to make a push for the playoffs. So it definitely hurts.”

The Yankees are two games behind Toronto in the chase for the second wild card.

Kershaw, in his second start after a serious back injury and his first at Yankee Stadium, was perfect for the first four innings and finished having allowed one hit in five innings. But that’s not the whole story.

Kershaw, who threw three innings in his return outing Friday, sat through a 12-minute rain delay following the top of the fourth and pitched the bottom of the inning. No biggie.

Yankees videos

The biggie was when Kershaw appeared on the mound for the bottom of the fifth after the second rain delay, this one lasting 48 minutes. Including the top of the fifth, Kershaw hadn’t thrown a pitch in more than an hour.

But Dodgers manager Dave Roberts sent his ace back out.

The Yankees had their only chance against Kershaw in the fifth. Castro led off with a hot shot that got past Turner at third for an error, and Chase Headley grounded a single to left for the Yankees’ first hit. Didi Gregorius sacrificed the runners ahead. Roberts brought the infield in, but Kershaw struck out Rob Refsnyder and Austin Romine to end the inning and his night.

“Obviously, Clayton was Clayton today,” Joe Girardi said. “We saw the good Clayton Kershaw today. His stuff was really good.”

Michael Pineda started for the Yankees and threw four shutout innings. He allowed two hits and walked two with five strikeouts and was lifted after 81 pitches.

advertisement | advertise on newsday

In the fifth, Girardi called on lefthander Tommy Layne to neutralize three lefthanded batters, and he did. Luis Severino added two scoreless innings and Tyler Clipper threw a perfect eighth.

The Yankees had another chance in the seventh, but pinch hitter Brian McCann struck out against lefthander Luis Avilan to end the inning with runners on first and second.

Girardi, who chose not to use switch hitter Mark Teixeira to bat for McCann, did not lament how the Yankees lost. Just that they did.

“The unfortunate thing,” Girardi said, “is we lost.”