Matt Moore (3-0) gave up two runs and five hits in 6 2-3 innings. Although his streak of scoreless starts ended at two, the left-hander has accounted for three of the Rays' five wins this season.
The six runs were the most the Rays scored in a game since a 6-0 win over Cleveland on April 6. Following that victory, Tampa Bay lost seven of eight before turning it around against the Orioles.
After going 1 for 34 with runners in scoring position in their previous five games, the Rays went 4 for 11 in those situations, including a two-run double in the fourth by Loney that put Tampa Bay ahead for good.
Loney went 3 for 3 to raise his batting average from .167 to .242. Johnson (2 for 5) went from .200 to .229, and Duncan got two hits to boost his average 44 points to .258.
Adam Jones homered for the Orioles, who had five hits.
Baltimore starter Chris Tillman (0-1) allowed four runs and six hits in four innings to fall to 1-4 against the Rays.
Tampa Bay manager Joe Maddon missed a portion of his team's first win in a week. He was ejected from the game in the fifth inning by umpire Brian Knight, who called Johnson out on a stolen base attempt. Maddon argued that Johnson beat the tag.
Johnson put the Rays up 1-0 with a first-inning shot into the right-field seats, his second homer in two games. In the bottom half, Moore struck out Chris Davis with two outs and runners on the corners.
Duncan connected in the second for a 2-0 lead. Both his home runs this season have come against Baltimore.
Jones tied it with a two-run homer in the third. The drive was initially called a double, but Orioles manager Buck Showalter insisted the ball went over the wall and bounced back into play. The umpires adjourned to watch a replay before confirming Showalter's assessment.
Tampa Bay got a pair of clutch hits in the fourth. After Evan Longoria led off with a double, Duncan looped a one-out single to center. As the throw from Jones came home, Duncan continued to second base. Loney followed with a sinking liner that got by Jones, allowing two runs to score.
In the sixth, Yunel Escobar hit a two-out RBI single for a 5-2 lead. The hit ended a 1-for-28 skid and was Escobar's first hit with a runner in scoring position in 15 tries this season.
Escobar was dropped to the No. 9 spot in the lineup, but Maddon insisted it had nothing to do with his .089 batting average. The manager said before the game that Escobar was "just a couple hits" from breaking the slump and "can do a lot of things" at the bottom of the order.
Loney added an RBI single in the eighth.