CC Sabathia (15-7) started and went 6 2/3 innings for New York, allowing four runs on eight hits with no walks and eight strikeouts.
Rocco Baldelli led Boston with two RBI.
Red Sox starter Josh Beckett (14-5) went eight innings, allowing eight runs on nine hits with five strikeouts and no walks.
The Yankees scored first when Jeter homered on the first pitch of the game, and never trailed after that. Matsui made it 2-0 with a solo shot in the second but the Red Sox tied it in the bottom of the second when Mike Lowell doubled with two out and scored on a single by Baldelli, who then scored on a double by Jason Varitek.
The Yankees made it 4-2 in the third when Jeter and Damon reached on back-to-back singles -- Jeter then scoring on an RBI single by Mark Teixeira and Damon crossing the plate on a ground out by Rodriguez.
Robinson Cano drove in what turned out to be the winning run with a solo homer, his 19th home run of the season.