Lewis followed Seager's go-ahead sacrifice fly that made it 2-1 with a three-run homer in the eighth off Tanner Scott.
''K-Lew was keyed up for it,'' Mariners manager Scott Servais said. ''He knew that guy was going to come right after him. But a lot of good at-bats in that inning that lead to that moment.''
Lewis, the 2020 AL Rookie of the Year, became the 54th major leaguer to reach 20 home runs by his 90th game. He hit the milestone in game No. 88, tying Alvin Davis for the fastest in Seattle history.
''He's been one of my mentors since day one,'' Lewis said. ''And it's kind of ironic that we ended up doing it at the same time. ... We always try to share moments throughout the year, so, you know, that'll be another thing that we can sit down and talk about.''
Rafael Montero (3-1) earned the win with a scoreless eighth. The Mariners have won four of six and are 10-4 following a loss.
Trey Mancini had three hits for Baltimore, including an RBI single in the ninth.
Seager opened the scoring with a solo home run in the fourth, then lifted a sac fly to right field with the bases loaded in the eighth, scoring Sam Haggerty. Seager leads the majors with a .500 batting average with runners in scoring position and has 19 RBIs in those situations.
Rio Ruiz answered Seager's homer with a solo shot of his own to make it 1-all in the fifth.
The pitches were rare mistakes for starters Justin Dunn of Seattle and Baltimore's Jorge Lopez, who each allowed three hits. Lopez was pulled with one out in the fifth after walking two straight batters, then allowing a single to Haggerty.
Adam Plutko got the Orioles out of the jam with a nimble sprint to first base and a tough grab for the third out of the inning on Mitch Haniger's grounder.
Dunn pitched 5 1/3 innings, striking out six and walking four. He got out of a bases-loaded jam of his own making after two walks in the second with a strikeout of Ruiz. The right-hander was pulled after his fourth walk gave the Orioles runners at first and second in the sixth.
Graveman induced two infield outs to escape the jam and extended his shutout streak with 1 2/3 hitless innings. He has struck out 14 and allowed five hits in a scoreless run that dates back to Sept. 19 last year.
Travis Lakins Sr. (1-3) took the loss after loading the bases in the eighth with a single and two walks, setting up Seager and Lewis.
Baltimore manager Brandon Hyde felt the game was lost earlier when the Orioles failed to convert multiple chances at the plate. They loaded the bases three times and left 12 runners on, going 1 for 9 with men in scoring position.
''We had so many opportunities to score,'' Hyde said. ''We just didn't get the big hit. We had traffic on the bases multiple times, we just couldn't drive them in. . We beat ourselves by not being able to push runs across earlier in the game.''
Orioles: Optioned LHP Bruce Zimmermann to the alternate training site. He's the second rookie starter the team has demoted, following Dean Kremer in April. Zimmermann was 1-3 in six starts. ''It's a similar-type situation where we're giving him a little bit of a breather, kind of a reset a little bit,'' Hyde said.
Mariners: Reinstated 1B Evan White from the bereavement list and recalled LHP Aaron Fletcher from the alternate training site as the team continues to shuffle its staff with three starters on the injured list. RHPs Wyatt Mills and Domingo Tapia were optioned to the alternate training site.
Mariners: Relief pitcher Keynan Middleton strained his biceps in the ninth and was removed from the game. Servais said the injury did not seem serious. ... LHP Nick Margevicius visited with a specialist and continued to undergo tests on his injured left shoulder. Servais said it's still unclear what is causing the pain. The starter went on the injured list April 26 after experiencing soreness during an appearance the previous day.
Orioles: LHP John Means (3-0, 1.70 ERA) makes his seventh start of the season in the series finale. Means has won two straight.
Mariners: LHP Yusei Kikuchi (1-1, 4.40) returns to the mound after taking a no-hitter into the seventh inning of his last outing.
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.