Mike Napoli took turns going from hero to goat and then hero again.
After a three-run homer in the third inning gave the Red Sox their first lead of the night, Napoli struck out twice and grounded into a bases-loaded, rally-killing double play in the eighth.
But in the bottom of the 11th, Napoli drilled a pitch from Adam Warren to give the Red Sox an 8-7 walkoff win over the New York Yankees.
The Yankees had rallied with two runs in the sixth and two more in the seventh, with an error by third baseman Jose Iglesias contributing directly to the two runs in the seventh.
After spotting the Yanks a 3-0 lead, the Red Sox began to claw back against Sabathia in the fourth.
A leadoff double by Jacoby Ellsbury and a single to left from Dustin Pedroia put the Red Sox on the scoreboard. After a single by David Ortiz, Napoli gave the Sox their first lead of the night with a mammoth homer over everything in left.
Shane Victorino's two-run single in the third upped the lead to 6-3 and when Jonny Gomes led off the fourth with a solo homer into the lights above the Monster Seats, the Sox were up by four.
Some sloppy defense by the Red Sox handed the Yankees two runs in the first.
With Brett Gardner on first, Dempster fielded a comebacker from Ichiro Suzkuki and fired into center field, giving the Yankees first-and-third. Then, with Robinson Cano at the plate, Ichiro Suzuki stole second and Jarrod Saltalamacchia's errant throw allowed Gardner to score and Suzuki to take third, from where he scored on a single to left by Vernon Wells.
A walk, a hit batsman, two groundouts and a single by Cano pushed the visitors' lead to 3-0 in the second and Dempster seemed to be teetering.
STAR OF THE GAME: Mike Napoli
It was an up-and-down night for the first baseman. He struck out three times and hit into an inning-ending, bases-loaded double play. But he also managed a three-run homer in the third to give the Red Sox their first lead of the night and a walkoff homer to center in the bottom of the 11th to give them the lead for good.
HONORABLE MENTION: Shane Victorino
After sitting out with another hamstring issue, Victorino returned to the lineup with a vengeance, collecting two hits, two RBI and two stolen bases.
GOAT OF THE GAME: CC Sabathia
The hefty lefty's 33rd birthday was one to forget - he couldn't get through the sixth and allowed seven runs to the Sox, while giving up two homers, pushing his season total to a career-high 23 -- in mid-July.
TURNING POINT: The Yankees had runners at first and second with one out in the 10th, but rookie lefty Drake Britton, making his second appearance in the big leagues, got Lyle Overbay to hit into a rally-killing double play.
BY THE NUMBERS: The win was the ninth walk-off win for the Red Sox this season and fourth won on a walk-off homer.
QUOTE OF NOTE: "I guess that's just a snapshot of his career bath. We live with some swing-and-miss, but the ability to drive the ball to all fields is present every time he steps into the batter's box." John Farrell on the streakiness of Mike Napoli.