David Ortiz homered twice, passing Hall of Famer Carl Yastrzemski for second place on Boston's career list, and Steven Wright pitched a three-hitter as the Red Sox beat the New York Yankees 5-1 on Sunday night.

Dustin Pedroia hit an early two-run homer and Xander Bogaerts also went deep for the Red Sox, who prevented a three-game sweep and won for the fourth time in six meetings with their longtime rivals this year.

In his farewell season, the 40-year-old Ortiz has five home runs against the Yankees since April 29.

Wright (3-3) walked one and struck out seven, breezing to his first complete game in 17 major league starts. He was two strikes from a shutout, too, when Brett Gardner homered with two outs in the ninth inning.

Ortiz connected for two long solo shots off a struggling Luis Severino (0-5).

(© 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed)

More From New Jersey 101.5 FM