In the top of the 10th, Brett Gardner worked a 10-pitch walk against Jonathan Papelbon before advancing on a sacrifice. Jeter dribbled a roller to the right side of the mound that Papelbon over-ran and Bill Hall flubbed a barehand pickup as Gardner raced home with the go-ahead run.
"That was luck. That's all you can say," Jeter said. "A check swing, the ball hit my bat, and fortunately it got past Papelbon. Sometimes that's how it goes."
But it was a bounce the Yankees needed. The Yankees remained assured of at least a share of first place in the American League East through play Saturday, with New York's magic number to clinch the division over the Rays at two.
"We've gotten the help we need up to this point," Jeter said. "Now we'll try to win another game."
Boston had tied the game in the eighth inning off Kerry Wood, who loaded the bases with three one-out walks. Wood bounced a wild pitch that squirted away from catcher Jorge Posada, allowing Eric Patterson to slide home safely with the tying run, a play that also saw Josh Reddick tagged out at the plate.
Phil Hughes was credited with the victory, his 18th, after pitching a scoreless ninth inning. The right-hander was called upon for just his second relief appearance of the year, assigned to work out of the bullpen this weekend in preparation for a potential start in the AL Division Series.
"A lot of the guys were giving me grief about it, but these wins are valuable, especially in this league," Hughes said. "I'll take whatever ones I can get."
Making his final tune-up start before the playoffs, Andy Pettitte was touched for three runs on nine hits in four-plus innings, needing 88 pitches to get that deep into the game. Pettitte wanted to have been more efficient, but he was satisfied with his stuff, striking out eight and walking three.
"I felt good out there," Pettitte said. "Obviously I wish my command would've been a little bit better and I wish I would have been a little sharper with my stuff. It was kind of a grind today as far as my location, but this one's over and we can look forward to the postseason."
The Red Sox got a pair of quick first inning runs off the bat of the retiring Mike Lowell, who was honored in a pregame ceremony. Stepping in against Pettitte with two on and two out, Lowell mashed a line drive to right field that shot over Nick Swisher's head and rolled to the wall for a two-run double as Victor Martinez and David Ortiz scored.
Daniel Nava also had an RBI single off Pettitte, who said he felt no effects from the stiff back he exhibited in his last start on Sept. 24 against the Red Sox in New York.
"I'm happy because we won," Pettitte said. "I wish I'd thrown seven innings, 90 pitches, absolutely dealt and put the ball right where I wanted to. I didn't, [and] it is what it is. I'm ready to go and just try to help us in the playoffs now."
New York took the lead in the third against knuckleballer Tim Wakefield. Jeter walked to open the inning and scored on Curtis Granderson's triple into the triangle in deep center field.
After an out, Alex Rodriguez chopped an RBI groundout that tied the game, and Robinson Cano crushed his 29th home run inside the right-field Pesky Pole.
The Yankees added two more runs in the fifth against Wakefield. Granderson worked a full-count walk and took off on a pitch, which Mark Teixeira blasted into left-center field for an RBI double. Cano picked up another RBI with a ground-rule double to left that Nava couldn't snag.
In the seventh, Boone Logan issued a leadoff walk and was relieved by Joba Chamberlain, who surrendered a hit to Hall and then uncorked a wild pitch that scored Lars Anderson with Boston's fourth run.
At four hours and 18 minutes, it took longer than even the Yankees had anticipated for another one of their showdowns at Fenway, but the desired result helped them quickly turn the page to the nightcap.
"We try to win every game we play," Jeter said. "You have that approach during the course of the year, and this is no different."
Bryan Hoch is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.