Marco Scutaro hit two homers and Adrian Beltre, David Ortiz and Victor Martinez also connected as warm temperatures on a late-summer night helped the ball carry out of Fenway Park. Four of the shots came off Matt Garza (14-8).
Wakefield (4-10) surpassed Hall of Famer Dennis Eckersley, who was 43 when he got his last win for the Red Sox.
The Rays dropped to 2 1/2 games behind the AL East-leading Yankees. Boston is nine behind New York.
Wakefield allowed five runs on six hits and four walks in five innings. B.J. Upton hit a three-run homer for Tampa Bay.
Ahead 4-0 early, the Rays let Boston tie it through three innings. Jason Bartlett's RBI single in the fourth put Tampa Bay in front, but the Red Sox took the lead 7-5 and chased Garza with a three-run fifth.
Martinez tied it with a leadoff homer into the back of the Red Sox bullpen. Ryan Kalish greeted reliever Chad Qualls with a go-ahead double off the left-field wall, a ball Carl Crawford might've caught if he hadn't pulled up and played the carom. Kalish scored when third baseman Evan Longoria bounced a throw to first for an error.
Garza gave up nine hits and six runs in 4 1/3 innings. He came in with a 3-0 with a 0.99 ERA in his last four starts.
Martinez's RBI single off reliever Randy Choate made it 8-5 in the sixth. Scutaro's second homer, his career-high tying fourth hit, made it 11-5 against Grant Balfour in the seventh.
Longoria's sacrifice fly had put the Rays ahead 1-0 in the first. They increased it to 4-0 in the second on Upton's homer, a drive that hit a billboard above the Green Monster.
The Red Sox tied it by scoring two runs in both the second and third. Beltre homered into the Monster seats after Ortiz walked, cutting it to 4-2 in the second. The homer gave Beltre 1,001 career RBIs.
Scutaro and Ortiz each hit solo shots into the left-field seats in the third.
Boston's Lars Anderson got his first two major league hits, both singles, and drove in a run.
This was Scutaro's first four-hit game with Boston. … The Red Sox tied their season-high with five homers. … Rays manager Joe Maddon said right-handed starter Jeff Niemann "had a great workout. There's nothing wrong. Once he gets his confidence back, he'll throw like he did the last year and a half." Niemann has given up 23 runs in 16 2/3 innings over three starts since coming off the DL from a strained shoulder on Aug. 25. … Maddon also said that Balfour, on the DL for 32 games with a strained ribcage suffered horsing around with pitching coach Jim Hickey before being activated Sept. 1, "is not quite where he had been." … Scutaro was back at shortstop after playing second on Tuesday because he has inflammation in the rotator cuff of his throwing shoulder, and the club wanted him to avoid longer throws. … Tampa Bay's Carlos Pena snapped 0-for-25 drought with a fifth-inning single.