NEW YORK -- Mike Napoli hit a tying grand slam in the seventh, Shane Victorino had a go-ahead homer one inning later and the Boston Red Sox rallied past the New York Yankees 12-8 on Friday night for their fourth straight victory.
Will Middlebrooks homered for the third straight day and Boston erased a five-run deficit in another wild game between these longtime rivals. One night earlier, the Yankees took an 8-7 lead with a six-run seventh -- only to lose 9-8 in 10 innings on Victorino's tiebreaking single.
New York has lost consecutive games when scoring at least eight runs for the first time since September 1949, according to STATS. The last time it happened with both games at home was 1911 against Cleveland.
Napoli also doubled, singled and walked twice in a perfect night at the plate. He scored three times, one night after sparking Boston's ninth-inning comeback with a two-out single off Mariano Rivera.
The Red Sox, who began the day with a 6 1/2-game lead in the AL East over Tampa Bay, have slowed New York's wild-card charge by winning the first two games of a four-game set, improving to 9-5 against New York this year. They have scored 41 runs in their past three games and won 11 of 13 overall.
Alfonso Soriano homered and Brett Gardner hit a two-run triple for the Yankees, but Phil Hughes and Boone Logan failed to hold an 8-3 lead for Andy Pettitte. New York went hitless after the fifth inning.
Victorino connected for a two-run shot off Preston Claiborne (0-2) in the eighth. Joba Chamberlain walked in a run later in the inning, and Stephen Drew made it 12-8 with an RBI single.
Brandon Workman (5-2) threw 1 1/3 hitless innings and Koji Uehara pitched a perfect ninth, running his scoreless streak to 27 innings over 24 games. He has retired 27 consecutive batters.
The game lasted exactly 4 hours, one night after the teams played 10 innings in 4:32.
Fired up all night, the 41-year-old Pettitte was pulled after six innings and 100 pitches. He struck out eight, but the bullpen betrayed him again.
In his previous outing, Pettitte was ahead 3-0 after 93 pitches when Baltimore chased him in a seven-run seventh inning. This time, Boston scored five runs in the seventh off Hughes and Logan.
If the Yankees could have held those leads, Pettitte would have won five straight starts.
Short in the bullpen after using seven relievers Thursday night, New York manager Joe Girardi called on Hughes to begin the seventh -- his first relief appearance since 2011. After going 4-13 with a 4.86 ERA in 26 starts this season, Hughes was demoted to the bullpen this week.
He gave up two singles and a nine-pitch walk to pinch-hitter Mike Carp after getting ahead 0-2. Dustin Pedroia drove in a run with an infield single, and Hughes walked off to boos from the crowd of 44,117.
Logan struck out David Ortiz before Napoli lofted a high fly toward the short porch in right. Ichiro Suzuki made a desperate leap, but the ball bounced off the ledge just behind the fence and caromed up into the crowd for Napoli's sixth career slam and third this season. He hit one off Hughes at Yankee Stadium on June 1.
Napoli raised his fist as he rounded first and received hearty high-fives when he returned to the dugout.
Daniel Nava then whistled a single past Logan's ear, and the left-hander came out with an injury.
Red Sox starter Felix Doubront was all over the place, throwing only 46 of his 88 pitches for strikes in 3 2/3 innings. He gave up three hits -- two triples and a homer. Four of the six hitters he walked scored.
Derek Jeter walked in the first inning and Soriano followed with his 30th home run of the season, 13 for New York. He has 43 RBIs in 39 games since the Yankees reacquired him from the Chicago Cubs on July 26.
Middlebrooks, batting ninth, homered leading off the fifth to give him eight RBIs in his last four games. But the Yankees made it 8-3 in the fifth on RBI singles by Vernon Wells and Mark Reynolds.
NOTES: Linda Pizzuti, the wife of Red Sox owner John Henry, tweeted a photo of the birthday cake - with a Yankees logo - that she said the Yankees made for Red Sox President and CEO Larry Lucchino as they celebrated at the ballpark. ... Red Sox CF Jacoby Ellsbury sat out with a sore right foot. ... C Jarrod Saltalamacchia missed his fourth consecutive game with a sore back. Saltalamacchia worked out during early batting practice and it's a "real possibility" he could be in the lineup Saturday, manager John Farrell said. ... A jovial Pedro Martinez was in the Boston clubhouse before the game, shaking hands, hugging Red Sox and looking for Ortiz. ... LHP David Huff, tabbed to replace Hughes in the rotation, makes his first start for the Yankees on Saturday against RHP John Lackey (8-12, 3.22 ERA).