The teams combined for seven home runs, tying a postseason record. The Rays wound up winning a game that lasted 5 hours, 27 minutes when the speedy Perez tagged up on Upton's one-out fly and beat right fielder J.D. Drew's throw home.
"Like I said, in a straight-up race, I've got him over Seabiscuit," Rays manager Joe Maddon said. "I'm dating myself a bit. I'm sorry, but that's the first horse that came to my mind."
"We did not want to go to Boston down 0-2," said Evan Longoria, who homered for Tampa Bay. "It's 1:30 in the morning and we pulled it out."
Dustin Pedroia homered twice for Boston, and scored his fourth run on a wild pitch in the eighth that made it 8-all.
Upton, who had homered earlier, followed with his fly ball down the right-field line.
"The main thing there is not to strike out," Upton said.
Drew settled under the ball, but rushed and a two-hop throw up the third-base line. Perez scored easily, showing off his best asset -- he stole 43 bases in Triple-A this season, and went 5-for-5 on steal tries with Tampa Bay.
"It's been like that all year, someone stepping up," Longoria said. "There's different heroes every day."
Jonathan Papelbon pitched 1 2/3 scoreless innings, getting the defending World Series champion Red Sox to the 11th. He extended his career postseason scoreless streak to a major league-record 22 innings over 14 appearances, despite getting struck by Carl Crawford's liner.
Cliff Floyd, Longoria and Upton homered for Tampa Bay off struggling Josh Beckett. The wild-card Red Sox homered three times in the fifth inning, with Pedroia and Kevin Youkilis connecting off Scott Kazmir and Jason Bay tagging Grant Balfour.
"It's very frustrating any time you get eight runs for you and you can't win the game," Beckett said.
After Boston won the ALCS opener 2-0, the teams came out swinging for the fences. All seven homers came in the first five innings.
The Red Sox and Ray matched the postseason record for homers set in the 1989 World Series and tied in the NLCS in 2003 and 2006.
Down 8-6, the Red Sox rallied within a run in the sixth on an RBI single by Bay.
Dan Wheeler took over and got Youkilis to ground into a double play. With Bay at the plate, Wheeler threw a pitch over the glove of Navarro that went to the backstop. The All-Star catcher retrieved the carom, but made an off-target, underhand toss to Wheeler covering the plate that allowed Pedroia to score.
Boston threatened again in the ninth when Crisp hit a two-out double that sailed over Upton's head in center field. Wheeler struck out Jacoby Ellsbury to end the inning.
Longoria, the All-Star rookie who homered twice in his playoff debut against the Chicago White Sox, snapped an 0-for-13 drought with a two-run homer in the first inning. Upton launched a solo shot in the third and Floyd homered in the fourth for Tampa Bay.
After Pedroia, Youkilis and Bay homered to put the Red Sox ahead 6-5 in the fifth, the Rays answered with three runs in the bottom half off Beckett, who allowed eight runs and nine hits in 4 1/3 innings. A year after becoming the first Red Sox pitcher to win four games in the same postseason, the big right-hander has struggled through the two shortest playoff starts of his career. He allowed four runs on nine hits in five innings against the Los Angeles Angels in Game 3 of the ALDS.
"We wanted Beckett to get through that fifth and set up our bullpen, and it didn't work," Boston manager Terry Francona said.
Bay, also had a two-run double in the first, was 3-for-5 with four RBIs for the Red Sox. Youkilis also had three hits and has now hit safely all nine of his career ALCS games.
Despite having their team-record six-game postseason road winning streak snapped, the Red Sox were happy to be returning to Fenway Park with the series tied 1-all.
"Why not?" Ortiz said. "Return to the house. Good things happen over there."
Kazmir allowed five runs and six hits in 4 1/3 innings. ... Youkilis' hitting streak in the ALCS is the longest to start a career since Darin Erstad hit safely in his first nine games for the Angels from 2002-05. ... Pedroia was 2-for-21 in the postseason before homering off Kazmir in the third and fifth innings. Including playoffs, he's 16-for-28 with three home runs lifetime against the Rays ace. ... The Red Sox also hit three home runs in an inning at Cleveland in Game 4 of last year's ALCS.