ST. PETERSBURG, Florida — Nelson Cruz put on quite a show on Sunday.
"Nelson has been spoiling us at a high level all year as a teammate and a player," Orioles manager Buck Showalter said.
After Nick Hundley drew a one-walk in the 11th, Cruz drove the next pitch from Cesar Ramos (2-6) over the wall in center for his 39th homer. Cruz has 101 RBIs this season.
Baltimore trailed 4-2 before Cruz's bases-loaded triple against Joel Peralta in the ninth. Tampa Bay tied it at 5 in the bottom half on pinch-hitter Sean Rodriguez's run-scoring grounder off closer Zach Britton.
Brad Brach (6-1) worked a scoreless 10th before Andrew Miller got three outs for his first save.
Baltimore increased its margin in the division to 9 1/2 games over the New York Yankees, who lost 2-0 to Kansas City.
"It wasn't a pretty victory but we got it done and that's the important thing," Cruz said. "You don't want to think about the standings too much but we are in pretty good shape and we just have to remain focused."
Evan Longoria, James Loney, David DeJesus and Kevin Kiermaier homered for the Rays. Tampa Bay had gone deep three times in its previous 15 games.
The Rays went 0 for 9 with runners in scoring position.
Orioles outfielders Adam Jones and Nick Markakis were out of the starting lineup, receiving a break from the artificial turf at Tropicana Field. Shortstop J.J. Hardy missed his second consecutive game due to back spasms.
Jones had a pinch-hit single in the ninth.
Longoria and Loney hit consecutive homers off Bud Norris in the first. Longoria has 39 RBIs in 47 games since the All-Star break.
DeJesus made it 3-0 with his fourth career inside-the park homer during the fourth. Left fielder Alejandro De Aza had the ball knocked out of his glove when center fielder David Lough ran into his teammate's arm. The ball ended up around the foul line, which allowed DeJesus to easily reach home.
Norris gave four runs and eight hits in six innings.
Cruz's two-run shot off Jeremy Hellickson made it 3-2 in the sixth. Hellickson allowed two runs and four hits over 5 1-3 innings.
"It does feel like a lot of our losses came like this," Hellickson said.
Tampa Bay has lost 14 of 22 since reaching .500 after dropping 18 games under the break-even mark.
The Rays went ahead 4-2 on Kiermaier's sixth-inning homer.
Orioles: Hardy expects to play in Monday night's game at Boston.
Rays: CF Desmond Jennings (sore left knee) might miss the rest of the season. The outfielder missed his 10th straight game. ... SS Yunel Escobar was out of the lineup due to flu-like symptoms.
Cruz is the first Baltimore player with seven RBIs in a game since Luke Scott against Seattle on July 7, 2009. He is the first player with at least seven RBIs to account for all of his team's RBIs since Colorado's Jason Giambi on May 19, 2011, at Philadelphia. In 18 previous games against the Rays this season, Cruz had two homers and seven RBIs.
Orioles: RHP Miguel Gonzalez (8-7) and Boston RHP Joe Kelly (1-1) are the scheduled starters Monday night.
Rays: After an off day, RHP Chris Archer (8-8) is scheduled to go against New York RHP Hiroki Kuroda (10-8) on Tuesday night at Yankee Stadium.