OAKLAND, Calif. - The Yankees were full steam ahead toward a third straight loss to the team with the American League's worst record when they were rescued by a player who quietly has resurrected his season after a horrendous start.

Carlos Beltran, who looked cooked after the month of April, continued his solid May Saturday night, putting his team ahead for good with a two-run homer in the sixth inning and adding an RBI single in the eighth as the Yankees beat the A's, 5-3, in front of 25,223 at O.co Coliseum.

Beltran, hitting .162 with a .216 on-base percentage with no homers after April, entered the game hitting .299 with a .311 OBP, three homers and 11 RBIs in 23 games this month.

"He's had a great month of May,'' Joe Girardi said, "and we just need it to carry over.''

Did Girardi see frustration from Beltran at the end of April? "His track record tells you he's going to come out of it,'' he said. "But there was frustration. It's just human nature to be frustrated in those situations, but he kept working at it, working at it, and he had to battle some health things when he was sick, but I think he's at full strength now and you're seeing Carlos.''

With the Yankees trailing 3-2 in the sixth, Brian McCann worked a walk against A's righthander Jesse Hahn and Beltran blasted a 91-mph fastball over the centerfield fence for a two-run homer. After Mark Teixeira reached on an infield single and stole second in the eighth, Beltran singled just in front of leftfielder Sam Fuld to make it 5-3.

advertisement | advertise on newsday

"Baseball is based on being able to have positive results, and right now I'm getting those,'' Beltran said, "and when you get those, you get more confident, you feel better about yourself. But at the end of the day, you have to take it month by month. You can't really judge your season based on one month.''

Did he ever worry that his stroke wouldn't come back? "No, not worried,'' he said. "I'm healthy, I feel good. It's just part of baseball. Sometimes you start the season hitting .340, all of a sudden you get to a month where you hit less than .200. Everything is magnified when you start the season slow. But at the end of the day, I believe it's not about how you start, it's how you finish. I'm happy that I feel good right now.''

The bullpen, called on early because Nathan Eovaldi lasted only 42/3 innings, struck out eight and allowed one hit in 41/3 shutout innings. After winning pitcher Chasen Shreve struck out all four batters he faced, Justin Wilson got the first two outs in the seventh. Dellin Betances got the next four outs, striking out three, and Andrew Miller pitched a perfect ninth to record his 15th save.

Eovaldi allowed eight hits in the first three innings -- he was fortunate to trail only 2-1 -- and gave up 11 hits and three runs in his 41/3 innings.

Eovaldi, who led the National League in hits allowed in 2014 with 223 in 1992/3 innings, has given up 76 hits in 571/3 innings this season.

Yankees videos

"Fastball felt good. I just wasn't locating very well,'' he said. "When I would get ahead of guys, I left it up . . . I had to battle tonight. I was able to keep them to singles. That was one good thing to take out of it, but I still have to do a better job of limiting the hits.''

Said Girardi, "I just don't think he had his great command tonight, but I thought he did a good job of minimizing [the damage] . . . but we really like this kid. I think he's a work in progress and I think he's making steps in the right direction and sometimes you're going to have nights like this.''

The Yankees, who scored eight first-inning runs in Eovaldi's previous start last Monday against the Royals, again gave the righthander an immediate, albeit smaller, lead.

Chase Headley singled with one out in the first and Alex Rodriguez lined a single to center, pulling him within 16 hits of 3,000. After Teixeira struck out, McCann, who had homered in each of his last four games and was 9-for-23 in his last seven, singled to right to make it 1-0.

Rookie leftfielder Ramon Flores, called up earlier in the day to replace the injured Slade Heathcott, and McCann teamed to keep it that way in the bottom of the first. With runners at first and second and two outs, Josh Reddick slapped a single to left. Flores charged and came up firing as A's third-base coach Mike Gallego waved Marcus Semien home. The throw was to the third-base side of the plate, but McCann grabbed it and dived the other way, applying the tag just before the sliding Semien touched the plate.

advertisement | advertise on newsday

The A's took a 2-1 lead in the third. Billy Burns, Semien and Stephen Vogt started the inning with consecutive singles to load the bases and Billy Butler smacked a sacrifice fly to deep center to tie it at 1-1. Reddick's hard single to right made it 2-1.

In the fourth, Eric Sogard made it four straight innings in which the A's leadoff batter singled. Two outs later, Semien singled to right for a 3-1 lead.

Headley (three hits) had a two-out RBI single in the fifth to make it 3-2. Beltran took it from there.

"It's great,'' he said. "At the end of the day, it's about wins, so it feels good every time you help the team win a ballgame, so today was a good day for me, it was a good day for the ballclub. We needed this one.''