Hernandez (9-4) walked two and struck out six, maintaining his 2.69 ERA, second lowest in the American League behind teammate Hisashi Iwakuma's 2.60.
Hernandez allowed two or fewer runs for the 13th time in 19 starts.
Ibanez's home run on a 0-2 pitch from Boston starter Jon Lester (8-5) broke a 2-2 tie in the fifth. It was the 41-year-old's seventh go-ahead home run and extended his hitting streak to 13 games.
His home run also gave the Mariners at least one long ball in 16 consecutive games.
Seattle pounded out 15 hits in winning for the fifth time in seven games. Boston has lost three straight, matching its season high.
Justin Smoak had three hits, including two doubles, and two RBIs for Seattle. Michael Saunders had two doubles and three RBIs.
Entering the game, Seattle had just two hits in its previous 32 at-bats with runners in scoring position, and were on an 0-for-19 run. After three innings, that run had extended to 0 for 25.
Kendrys Morales opened the fourth with a hard single to left. Kyle Seager followed with a single that just ticked off second baseman Dustin Pedroia's glove. The ball trickled into right field, allowing Morales to reach third.
With one out, Smoak finally broke the stretch of futility with double just inside the third-base bag. Morales scored and Seager advanced to third.
Mike Zunino walked to load the bases and Saunders walked to drive in Seager.
Boston responded in the fifth with a pair of runs. Daniel Nava had a RBI single and Brock Holt raced home from third on a wild pitch to make it 2-2.
Ibanez's leadoff home run in the Mariners' fifth gave them the lead for good. He has hit eight home runs in his last 13 games.
Ibanez, who turned 41 on June 2, has 203 doubles and 149 home runs as a Mariner. He is one home run from joining Ken Griffey Jr., Edgar Martinez, Jay Buhner and Alvin Davis as the only Mariners with at least 200 doubles and 150 home runs.
Smoak, Ibanez, Brad Miller and Nick Franklin added RBI hits. Mike Napoli and Jarrod Saltalamacchia each had RBI doubles in the eighth for Boston.
NOTES: With RHP Jeremy Bonderman designated for assignment Monday, the Mariners need a starter Thursday. "We'll be pulling someone up for that," Manager Eric Wedge said. It could be RHP Erasmo Ramirez, coming back from a triceps strain, or RHP Brandon Maurer, who began the year with the big club. . Wedge said Tom Wilhelmsen has worked his way back into the closer role after a three-week absence for inconsistency. . The Red Sox were without Jacoby Ellsbury (left wrist) and Shane Victorino (left hamstring), so manager John Farrell said he had to go with a "makeshift" lineup. Ellsbury is working on a season-high 17-game hit streak and has a major league-high 36 steals. . LHP Andrew Miller is expected to have surgery for a damaged left foot ligament and likely will be out for the season.