Detroit answered with four in the fifth. Dirks hit a solo shot, and Cabrera's 20th homer of the year made it 6-5 and upped his RBI total to 74.
"Probably throw the best changeup I've ever thrown in my life to a guy that's just on a whole other playing field," Lester said. "Wish he'd quit and go to a different league — make a league especially for him, I guess. I thought at first it was off the end, and apparently not."
Jose Iglesias tripled in the sixth and scored on a single by Victorino.
On Cabrera's third hit — a single to right in the seventh — Victorino tried to throw him out at first from the outfield. Cabrera beat the throw and appeared to laugh and yell something in Victorino's direction.
Victorino nearly had a fifth hit in the eighth. With the bases loaded and one out, Peralta fielded his slow chopper and tried unsuccessfully to get a force at home. Boston took an 8-5 lead on the play, but it was ruled a fielder's choice and not a hit.
That was the first of two close plays at the plate that went Boston's way in the eighth. The second came when Al Alburquerque threw a wild pitch and came home to cover the plate. Pena retrieved the ball, but Stephen Drew appeared to get his arm under Alburquerque's tag attempt, and the Red Sox took a 9-5 lead.
Boston added a run in the ninth thanks to an error by center fielder Avisail Garcia, which allowed Drew to score from first on a single by Iglesias.
Miller pitched the ninth for Boston, his first appearance at Comerica Park since he was traded from Detroit to Florida after the 2007 season as part of the deal that brought Cabrera to the Tigers. He gave up a single to Cabrera and an RBI grounder by Prince Fielder.
NOTES: Boston signed C Jon Denney, their third-round draft pick this year. The Red Sox also agreed to terms with four other draft picks: LHPs Corey Littrell, Jake Drehoff and Gabe Speier and OF Jordon Austin. ... Detroit agreed to terms with two draft picks: LHP Kevin Ziomek and RHP Austin Kubitza. The Tigers also agreed to terms with C Chris Taladay, an undrafted free agent. ... Boston RHP Allen Webster (0-1) faces Detroit RHP Max Scherzer (10-0) on Saturday night.