The Tampa Bay Rays appeared headed toward a fifth straight loss at home until things changed in the late innings.
Jake Elmore homered, Brandon Guyer had a two-run, pinch-hit single in a four-run sixth and the Rays rallied from a four-run deficit to beat the Boston Red Sox 7-5 on Wednesday night.
"We needed that one," Tampa Bay manager Kevin Cash said. "For the guys to come back from that deficit against that team, it just keeps impressing all of us, showing what they're about."
After a tiebreaking run scored on Desmond Jennings' double-play grounder, Elmore gave the Rays a 7-5 advantage with his solo shot off Edward Mujica (1-1) on his first at-bat with Tampa Bay after having his contract purchased from Triple-A Durham before the game.
"That was about as good as you could draw it up," Elmore said.
Tampa Bay had tied it at 5 in the sixth. Allan Dykstra drove in a run with the fourth consecutive single to start the inning before Logan Forsythe drew a four-pitch, bases-loaded walk that ended Joe Kelly's game. Guyer hit his two-run single off Craig Breslow.
"I didn't get ahead of hitters," Kelly said, "In the sixth inning, I tried to get too fine and fell behind hitters, and had to throw it down the middle from there."
Brad Boxberger (1-1) struck out all three batters he faced in the seventh to help Tampa Bay stop a four-game skid to begin a nine-game homestand. Steve Geltz pitched the ninth for his first career save.
Dustin Pedroia and David Ortiz homered for Boston.
Pedroia hit a two-run shot off Nathan Karns during a three-run third as the Red Sox took a 3-1 lead. Hanley Ramirez scored the other run from first base on Mike Napoli's single that went off Karns' glove and ended up in center field.
Ortiz made it 4-1 on a fifth-inning solo homer. The designated hitter moved past Joe DiMaggio into 46th place on the career RBI list with 1,538, and also broke a tie with Chipper Jones for 32nd place on the homer list with his 469th shot.
Mookie Betts had a run-scoring single in the sixth for Boston.
Steven Souza Jr. put the Rays up 1-0 with a first-inning homer. He departed after striking out to the end the sixth due to a right forearm cramp but is hopeful of playing Thursday.
"Nothing crazy happened," he said. "Just precautionary."