Tampa Bay (87-56) trailed 4-1 after two innings but emerged with the win after Diaz's two-run blast off Tayler Saucedo (3-2). Diaz finished with three RBIs for the Rays, who moved a season-high 31 games over .500.
Julio Rodriguez set a career high with his 29th homer and Ty France singled in two runs for Seattle (79-63). Colin Poche (11-3) pitched a scoreless ninth inning for the win.
The Rays took their first lead of the game at 5-4 after scoring two runs in the seventh inning. Taylor Walls' one-out single scored Jonathan Aranda, who hit a leadoff double. Diaz then entered as a pinch hitter and doubled on a 3-2 pitch to put the Rays ahead.
Seattle quickly tied the game with two outs in the top of the eighth when Eugenio Suarez scored from third on Robert Stephenson's wild pitch.
The Mariners claimed an early lead with three runs in the first inning against Aaron Civale. Dominic Canzone drew a bases-loaded walk with one out and France followed with his two-run single.
Tampa Bay responded in the bottom of the first with Isaac Paredes' two-out RBI double off Trent Thornton. Paredes later exited the game after being hit by a pitch on his right hand in the fourth inning.
Rodriguez's solo blast with two outs in the second inning gave the Mariners a 4-1 advantage. The 373-foot homer was Rodriguez's eighth in his last 12 games.
Civale allowed four runs on four hits with three walks and three strikeouts in five innings.
Tampa Bay pulled within 4-3 with two outs in the fifth inning when Brandon Lowe lined a two-run double into the right field corner.
Seattle right-hander Luke Weaver relieved opener Thornton in the third inning and allowed four runs over 4 1/3 innings.
—Field Level Media