The Yankees have long gotten the better of David Price, with no player representing that success more than Gary Sanchez.

He homered twice in five at-bats against Price last season and doubled that total the first three times he came up Thursday night.

Sanchez, who homered twice for the second time in his last six games, drove in five runs to back Michael Pineda and lead the Yankees to a 9-1 victory over the Red Sox in front of a sellout crowd of 46,194 at the Stadium.

“He’s a great hitter. I saw that in the minor leagues for years,” Aaron Judge said of Sanchez. “You saw what he did last year for two months, and I think he’s starting to feel it a little bit now.”

The Yankees (34-23), who also got Brett Gardner’s 13th home run in 143 at-bats in the last 35 games, did their share of damage to the Red Sox (32-27) in taking two of three and increasing their AL East lead to three games.

Judge had three of the Yankees’ 13 hits, raising his average to a team-best .330 and his OBP to .436, best in the AL. His scorched sixth-inning single back up the middle nearly beheaded Fernando Abad and came off the bat at 119.8 mph, the hardest-hit ball in the majors this season.

advertisement | advertise on newsday

Chase Headley and Gardner had an in-game side bet on the hit, with Gardner saying he thought it was Judge’s hardest-hit ball this season and Headley feeling otherwise. “I was like, ‘he’s hit 15 balls harder than that,’ ” Headley said, adding with a smile: “Judge said he didn’t hit it that good, either.”

“That’s why I call him the animal,” Sanchez said admiringly of Judge, a player he came up with through the Yankees’ system. “He’s amazing.”

People were saying that about Sanchez last season when he hit 20 homers in 53 games, 19 of them in a 37-game stretch. Given that standard, he was off to a slow start in 2017.

He homered twice a week earlier in a 12-2 victory over the Blue Jays at Rogers Centre, but that didn’t spark him, so Joe Girardi dropped him from second to sixth Wednesday. That, Girardi said, had more to do with Aaron Hicks’ standout season than anything else.

“I wouldn’t say that it felt like I was being demoted or a negative,” Sanchez said through his translator. “If I’m in the lineup, I’m happy with that, just to have the opportunity to play. Hitting second, I wasn’t doing my job, and now he has me hitting sixth and that’s fine. As long as I can contribute, that will always be fine.”

Yankees videos

Sanchez, who is only 6-for-26 in his last six games but has four homers and nine RBIs in that span, hit a three-run homer to left-center in the third inning to make it 4-0 and a two-run shot to right-center in the fifth to make it 6-1. The second homer gave Sanchez four in seven career at-bats against Price.

Pineda (7-3, 3.39), who allowed five runs and a season-high 10 hits last Friday, allowed an unearned run, four hits and two walks in seven innings. He struck out eight, giving him 75 strikeouts and 17 walks in 71 2⁄3 innings this season.

Price entered the game 1-0 with a 3.00 ERA since coming off the disabled list, but with an ERA of 4.55 in 35 career starts against the Yankees.

Thursday night’s performance no doubt made the postgame Q&A more difficult for the lefthander, who created headlines a night earlier with an expletive-laden run-in with a Red Sox beat reporter.

Price, irritated early on with plate umpire Vic Carapazza’s strike zone, allowed six runs, eight hits and four walks in five innings. He threw 107 pitches.

advertisement | advertise on newsday

“Just a big night from Gary,” Girardi said. “And I thought our guys did a really good job of making David work today.”