The Orioles forged a 2-2 in the seventh on Jake Fox's pinch-hit RBI double, and then struck for two more in the eighth.
Vladimir Guerrero collected a two-out single off J.P. Howell (2-3) and Wieters followed by pulling a 1-1 pitch deep into the left field stands, handing the Orioles a victory in the middle contest of a three-game set.
Troy Patton (1-1) earned the victory with an inning of scoreless relief and Jim Johnson recorded the final out for his fifth save.
David Price started and surrendered two runs (one earned) on four hits over 6 2/3 innings for the Rays, who lost for only the second time in 10 games.
They entered the contest three games behind Boston in the American League wild-card chase.
Evan Longoria smacked a two-run homer for the Rays.