Miller has four home runs this season, which have come in a pair of two-homer games. He connected for his first two big league homers on July 19 at Houston.
Tampa Bay also got two homers from its leadoff hitter, Ben Zobrist.
According to the Rays, it is just the third time since 1916, when records are available, that both leadoff hitters had multihomer games. The others were June 5, 1994 (Minnesota's Chuck Knoblauch and Tony Phillips of Detroit) and July 8, 1965 (Houston's Joe Morgan and Felipe Alou of the Milwaukee Braves).
After Justin Smoak ended Chris Archer's night with a leadoff single in the sixth, Dustin Ackley gave Seattle a 5-4 lead on a triple off Wesley Wright.
Zobrist got the Rays even at 4 on his second homer of the game, a two-run shot in the fifth against Erasmo Ramirez (4-0), who allowed four runs and seven hits in 5 1-3 innings.
Danny Farquhar pitched the ninth for his fifth save.
Smoak had a two-run single through a defensive shift as the Mariners went ahead 3-2 in the fourth. Miller's second homer of the game, a fifth-inning shot, made it 4-2.
Archer (6-5), who left his previous start last Wednesday at Arizona after 1 2-3 innings due to right forearm tightness, gave up five runs and nine hits over five-plus innings.
Miller opened the game with his first leadoff homer and the Mariners' eighth this season, which extended the team record.
Zobrist tied it at 1 in the bottom of the first on his first career leadoff homer and 100th overall in the majors. The Rays took a 2-1 lead later in the inning on James Loney's RBI single.
It was the first major league game since Aug. 31, 2011, when St. Louis' Rafael Furcal and Milwaukee's Corey Hart did it, where both teams hit leadoff home runs, according to STATS.
It last occurred in the AL on Aug. 17, 2006, in games between Baltimore (Brian Roberts) and New York (Johnny Damon), and Kansas City (David DeJesus) against Chicago (Pablo Ozuna).
NOTES: Tampa Bay RHP Alex Cobb is expected to make his first big league start Thursday night since getting hit in the head by a liner on June 15. ... The Mariners plan to look at Ackley in center. "We're trying to see what we have out there with Ackley," acting Seattle manager Robby Thompson said. ... Rays CF Desmond Jennings (broken left middle finger) could start dry swings with a bat in the next few days. ... Tampa Bay optioned RHP Josh Lueke to Triple-A Durham.