Welcome to the rivalry, J.D. Martinez.

The Boston Red Sox slugger got his first taste of baseballs fiercest rivalry in April when the Sox took two out of three from the New York Yankees at Fenway Park in a hotly contested series that included a bench-clearing brawl.

But Martinez went 3-for-13 with one RBI in those three games — not exactly the offensive output the new slugger wanted in his first go-around against his new rival.

Thursday was a different story, though.

After dropping the first two games at Yankee Stadium, the Red Sox had seen their lead in the American League East evaporate and were in danger of being swept by their red-hot nemesis after the bullpen blew a four-run lead in the seventh, allowing the Yankees to tie the game.

That’s when Martinez made his first imprint on the rivalry.

Leading off the eighth inning, the Red Sox outfielder took an inside fastball from right-hander Dellin Betances and lifted it to deep right field. While Fenway Park’s spacious right field has cost Martinez some opposite field dingers early in the year, the short porch at Yankee Stadium gave him one back, as the ball barely cleared the wall for what ended up being the game-winning run.

And Martinez’s heroics came at the behest of teammate Hanley Ramirez.

“I told him before he went up he better hit a homer right here,” Ramirez said, as seen on NESN’s postgame coverage. “You know, and he did. That’s good. I told him to his face, ‘We need a homer from you right here,’ and he went out and hit it.”

Martinez did what he was told, and the Red Sox left the Bronx tied for the lead in the AL East.

Here are more notes from Thursday’s Red Sox-Yankees game:

— Eduardo Rodriguez now has the third lowest ERA among active pitchers at the new Yankee Stadium. After tossing five shutout innings Thursday, the Red Sox left-hander boasts a 2.25 ERA in his career in the Bronx, trailing only Seattle Mariners ace Felix Hernandez (1.41 ERA) and teammate Chris Sale (2.18 ERA).

— Red Sox left-hander David Price threw a bullpen session Thursday and is expected to make a start Saturday against the Toronto Blue Jays despite being diagnosed with carpal tunnel syndrome.

— Manager Alex Cora announced that Steven Wright will head to the bullpen when he is done serving his 15-game suspension. He will be activated Monday, May 14.

— The Red Sox and Yankees now are tied atop the AL East with identical 26-11 records.

Thumbnail photo via Adam Hunger/USA TODAY Sports Images