Rafael Devers celebrates after hitting one of his two home runs on Friday night in a win over the Yankees at Fenway Park in Boston. Elise Amendola/Associated Press

BOSTON — Rafael Devers hit two home runs, including a go-ahead blast in the fifth inning, to help the Boston Red Sox beat New York Yankees ace Gerrit Cole for the second straight time at Fenway Park in a 6-2 win Friday night.

Devers followed his two-run shot with a three-run homer in the seventh – the 100th of his career.

It marked the second consecutive game the Red Sox rallied from a 1-0 deficit. They earned their ninth victory over  New York in 11 meetings this season. Boston, which has won its last four overall, has now come from behind in 31 of its AL-leading 60 wins. The Red Sox also maintained their one-game AL East lead over Tampa Bay and increased their lead to nine games over the third-place Yankees.

Yacksel Rios (3-0) got the victory, pitching two scoreless innings to cap a strong night from the bullpen after starter Eduardo Rodriguez left in the second inning after experiencing migraine symptoms.

Cole (10-5) started strong for New York, but was pulled after five innings, giving up three runs on six hits, striking out eight and walking two. He has now surrendered five home runs at Fenway this season.

Rodriguez was walking back to the mound after giving up the game’s first run, an RBI double to Brett Gardner, when he put his hands on his hips and doubled over.

He was attended to by trainers before walking off the field on his own power alongside Manager Alex Cora, who put his arm around him. Rodriguez was replaced by Phillips Valdez. He hit the second batter he faced but struck out the side to limit the damage to a run.

Phillips Valdez allowed one hit over three shutout innings, striking out seven and walking opne, after he came on in relief of starter Eduardo Rodriguez, who left after one inning with a migraine. Elise Amendola/Associated Press

Rodriguez’s line for the night was one run off three hits, one strikeout and a walk.

Cole was spot on in a win over Boston last week. He looked to be in command early Friday, dialing up a four-seam fastball that consistently topped 100 mph.

The pitch was there for him in the third inning when he was nursing a 1-0 lead and the Red Sox got two on with one out. He struck out both Xander Bogaerts and Devers on 3-2 pitches. But things changed in the fifth when Kiké Hernández got on with a one-out single. Jarren Duran then battled for six pitches before driving a liner into center that bounced into the seats for a ground-rule double.

Bogaerts was next and lifted a sacrifice fly to right field that scored Hernandez. Devers then made it 3-1, lifting his 25th homer of the season just over the top of the Green Monster.

NOTES: Red Sox: Placed RHP Hirokazu Sawamura on the 10-day IL with right triceps inflammation and recalled Valdez from Triple-A Worcester.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.