NEW YORK — A day after hanging out at Sonny Gray’s house and catching up with his buddy, Kendall Graveman faced him at Yankee Stadium.

Khris Davis, Matt Chapman, Jed Lowrie and Matt Joyce all homered and the Athletics beat the Yankees 10-5 Friday night, leaving New York with back-to-back losses for the first time in more than a month.

The A’s had lost three in a row before tagging Gray, their former ace. Oakland has won five in a row overall against the Yankees.

Recalled from the minors to make the start, Graveman (1-5) worked quickly and efficiently, needing just 43 pitches to get through the first four innings.

“It was kind of a unique feeling to step on the same rubber as him in the same game,” Graveman said.

The Athletics’ opening day starter, Graveman was optioned to Triple-A after going 0-5 with an 8.89 ERA. He allowed four runs, only one of them earned, on three hits and two walks over six innings, striking out four.

Marcus Semien drove in four runs for the A’s, three on a double in the ninth inning.

Davis led off the second inning with his 10th home run, driving a fastball into the right-field bleachers. After Matt Olson singled, Chapman hit an 0-2 pitch 429 feet into the loading dock in center for a 3-0 lead.

Gray (2-3) was acquired from Oakland just before last year’s trade deadline for outfielder Dustin Fowler and two minor leaguers. Drafted 18th overall in 2011, Gray was 44-36 with a 3.42 ERA over parts of five seasons with the A’s.

“I felt good, I just couldn’t put it together,” Gray said.

Making his first start in the majors, Fowler lined a single to right in his second at-bat, notching his first big league hit against the player he was traded for. Once a rising star in the Yankees’ system, Fowler suffered a major knee injury while trying to make a catch last June in his debut and was dealt to Oakland a month later.

“I had a long journey ahead of me from last year to now but I was happy to actually get my hit here,” Fowler said.

Gray allowed five runs on nine hits over five innings, walking three.

Aaron Judge hit his 10th homer and rookie Gleyber Torres hit his third for the Yankees.

“We always feel like we’re in every game,” Judge said. “We just weren’t able to string a lot of hits together.”

Blake Treinen got four outs for his sixth save in eight chances.