"He said, 'We're going to score five,'" Davis recalled. "And I believed him."
Longoria's words turned out to be prophetic, even if they were a little off target.
It was the first time the Rays overcame a five-run deficit to win since June 1, 2010, when they rallied to win 7-6 at Toronto.
Davis (8-7) was the biggest benefactor, earning his first win since June 25. He gave up five runs and six hits in the first inning then didn't allow another runner and finished with six strikeouts in his second start since coming off the disabled list.
"After the first I toned it down a bit," said Davis, who didn't walk a batter for the second straight start. "I was really aggressive in the first inning and I was missing just by a little bit here and there. I just tried to keep the game there."
|More on Rays at A's|
He did, and his teammates rewarded him with their highest-scoring inning of the season.
Longoria homered to cap the seventh and B.J. Upton, the subject of ongoing trade rumors, hit his team-leading 16th home run in the eighth.
Every Tampa Bay starter had at least one hit or scored in the seventh. Jennings, who hit a two-run homer off starter Rich Harden in the sixth, had a two-run single in the inning before Longoria capped the outburst with his 14th homer.
In all, Tampa Bay had five hits and three walks the inning and all three batters who walked scored.
"We knew Wade could pitch and all we had to score some runs," said Jennings, the Tampa Bay rookie who had a season-high four RBI. "We felt it was turning when we started to get base runners and walking. If you just keep getting on base something is going to happen."
Conor Jackson had a two-run homer in the first when the A's hit for the cycle with four consecutive batters, but Oakland's bullpen imploded and wasted a solid outing by Harden.
A day after tagging James Shields for 10 runs as part of a 13-6 blowout, the A's jumped on Davis for five runs in the first and appeared on their way to a second straight rout.
"We just couldn't shut it down in the seventh inning, that's basically what it came down to," Oakland manager Bob Melvin said. "When you put guys on base and they don't work their way on, a lot of times it ends up haunting you."
Joel Peralta, Jake McGee and Kyle Farnsworth finished off the A's over the final three innings to help Tampa Bay win for only the second time in its last seven games. Farnsworth earned his 20th save in 24 tries.
The A's, who had a nine-run fourth inning Wednesday, blew a five-run lead for the second time this season.
All of the damage in the seventh came against Oakland's bullpen.
Ziegler (3-2) failed to retire a batter and took the loss.
"For it to unravel and to give away a lead like that is tough, no matter how many guys took part in it," Ziegler said.
Upton hit his one-out solo shot in the eighth off Trystan Magnuson.
That spoiled an otherwise solid outing by Harden, who gave up three hits and two runs over six innings. The right-hander, who missed the first three months of the season with a strained right shoulder, retired the first nine batters and didn't allow a hit until Ben Zobrist's leadoff single in the fifth.
Harden retired the next two batters and finished with seven strikeouts and two walks. He left with a 5-2 lead but wound up with a no-decision after the meltdown by the bullpen.
Cliff Pennington's one-out single preceded the Oakland cycle. Hideki Matsui singled, Josh Willingham hit an RBI double and David DeJesus followed with a two-run triple before Jackson's home run made it 5-0.
It was the first time in their Oakland history that the A's have hit for the cycle with four consecutive batters. It also marked the eighth consecutive game in which they have scored at least four runs, the team's longest such streak since 2007.
Kurt Suzuki homered in the seventh for Oakland, DeJesus had an RBI fielder's choice grounder in the eighth and the A's added another run in the ninth before Farnsworth struck out Pennington with a runner at second to end it.
- Pennington, who entered the game as the hottest hitter in the majors since the All-Star break, extended his career-high hitting streak to 12 games.
- The Rays traded former All-Star INF Felipe Lopez to Milwaukee for cash. Lopez batted .216 in with two home runs and eight RBI in 32 games with the Rays this season but had been designated for assignment twice.
- Tampa Bay called up RHP Mike Ekstrom from Triple-A Durham to replace RHP Rob Delaney, who was optioned following Wednesday's game.
- The last team to hit for the cycle with four consecutive batters was Colorado on June 6, 2008.