Lynn (6-3) gave up five singles and one walk and had a season-high 11 strikeouts in his 200th career start. Kelley, who was activated from the 10-day injured list on Tuesday, allowed a two-out ninth-inning homer to Omar Narvaez, who had three hits, in earning his third save of the season.
The loss continued a tailspin for Seattle, which is 10-26 since a 13-2 start.
Nomar Mazara had three hits, an RBI and scored one of his two runs on a sacrifice fly after initially being ruled out at the plate before a successful Texas challenge. Joey Gallo hit a two-run home run, his 15th of the season, in the eighth inning.
Lynn had a shutout going into the seventh until an RBI single by Narvaez that nearly cleared the right-field fence. With the tying run at second base and one out, Lynn struck out Tim Beckham and J.P. Crawford to hold the lead and finish with 120 pitches, his highest total since May 2017.
"That was my inning to finish," Lynn said. "I wanted to clean up my mess."
Rangers manager Chris Woodward said he gave Lynn such leeway with an extra day's rest coming up.
Kelley was told he would pitch either the eighth or ninth inning. Woodward gave the eighth and a one-run lead to Jose Leclerc, who retired the side in order and has set down 16 straight batters over his last four games.
"I'd be lying to you if I didn't say there weren't thoughts over the last few weeks of, `Will I play again?" said Kelley, 35. "It was really fun to be out there and just be in a situation to help the guys."
"It was awesome to have Kelley back out there," Woodward said.
The Rangers have won six of their last seven games to reach .500 at 23-23. Last season, they were at .500 once en route to finishing last in the American League West at 67-95.
Left-hander Tommy Milone (0-1) survived a 31-pitch first inning and allowed two runs on three hits in five innings in his first major league start of the season. Milone's contract was selected from Triple-A Tacoma earlier in the day.
Milone, 32, said his pre-game nerves were "more excited than anything."
"It was just a lot of fun to get back out there and be up here," he said.
LIL' HELP, PLEASE
The Mariners played without second baseman Dee Gordon and third baseman Ryon Healy, each placed on the 10-day injured list before the game. Gordon has a right wrist contusion, and Healy has lower back inflammation.
Rookie Shed Long, recalled from Tacoma, replaced Gordon and singled in the sixth inning for his first major league hit in his 11th big league at-bat.
"Been joking with him a little bit," Mariners manager Scott Servais said. "I said, `You'll eventually get a hit."
Rangers: LF Willie Calhoun left the game after six innings with tightness in his left quad. ... SS Elvis Andrus (right hamstring strain) began a rehab assignment Tuesday with Double-A Frisco, going 0 for 3 with one strikeout as the designated hitter.
Mariners: In the series finale on Wednesday afternoon, LHP Marco Gonzales (5-3, 3.65 ERA) will seek to end a three-game losing streak during which he has a 5.93 ERA after compiling a 2.80 ERA in his first seven starts.
Rangers: RHP Adrian Sampson (1-3, 4.79 ERA) will make his second straight appearance when following an opener, this time Jesse Chavez. Sampson earned his first major league win last Friday, limiting the St. Louis Cardinals to one earned run in 5 1/3 innings.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports