Torres hit his 13th homer when he drove a full-count, 96 mph fastball from Blake Snell (8-4) into the left field seats. Torres' latest homer traveled an estimated 393 feet.
Hitting fifth for the third time, Torres homered in consecutive games for the second time. He also did it May 21-25, when he homered in four straight games.
The latest homer was his eighth to tie a game or give New York the lead, matching Hall of Famer Mickey Mantle (1951) for the fourth most among Yankees rookies.
Before Torres homered, Aaron Hicks pulled Snell's changeup into the right center field seats. Aaron Judge followed the first homer with a single and Gary Sanchez drew a walk.
Domingo German (1-4) set a career high with 10 strikeouts in six innings. He allowed three runs on five hits in six innings and notched his first career victory.
Chad Green and Dellin Betances pitched a scoreless inning apiece. Aroldis Chapman pitched a perfect ninth and recorded his 19th save.
Matt Duffy homered on the first pitch of the game, Wilson Ramos hit an RBI single in the third and Joey Wendle delivered an RBI single in the sixth for Tampa Bay. The Rays lost for the 11th time in their past 13 trips to Yankee Stadium and struck out 15 times.
The Yankees won for the 11th time in 14 games on a night when left fielder Giancarlo Stanton and Sanchez had quiet nights at the plate but contributed defensively.
Stanton heard boos for going 0-for-4 with a pair of strikeouts but also threw out Duffy at the plate in the third.
Sanchez returned after sitting out the two games with the Washington Nationals and went 0-for-2, lowering his average to .188. Sanchez threw out Carlos Gomez trying to steal third for the second out of the seventh.
Snell allowed four runs on five hits in five innings. The left-hander saw a personal four-game winning streak stopped and took his first defeat since lasting 3 1/3 innings in a 17-1 loss at Baltimore on May 13.
Snell also allowed more than two runs for the third time in 15 starts this season.
--Field Level Media