Mika Zibanejad had a goal and two assists for the Rangers, who improved to 14-4-2 on home ice.
Yanni Gourde tied the game with a power-play goal for Seattle with 1:08 left. The Kraken had pulled goaltender Philip Grubauer pulled for an extra skater.
But Miller put New York back in front when he rifled the puck past Grubauer for this third goal of the season, sending the crowd into a frenzy.
Despite being outshot 42-24 by the Kraken, the Rangers won for the 10th time in 15 contests.
Shesterkin, 21-5-2 this season, won for the eighth time in his last nine starts. In his last 16 starts, the Russian netminder has allowed two or fewer goals in 11 of them.
Zibanejad opening the scoring with his 17th goal on the power play at 11:46 of the first, one-timing a cross-ice pass from Artemi Panarin past Grubauer.
Zibanejad is on a scoring surge with 12 goals and 14 assists in his last 18 games.
Panarin, who leads the Rangers with 49 points, has points in seven out of his last eight games, with two goals and 11 assists.
Defenseman Jacob Trouba also assisted on Zibanejad’s 10th power-play goal of the season.
The Kraken outshot the Rangers 14-6 in the first.
Alexis Lafreniere put the Rangers ahead 2-0 with his ninth goal of the season at 4:23 of the second.
Kraken forward Jared McCann narrowed the deficit with his team-best 18th goal, beating Shesterkin at 7:17 of the second.
McCann scored for his fourth straight game and leads the expansion Kraken with 27 points overall.
Shesterkin made his best save of the third when he denied Marcus Johansson on a Kraken power play early in the period.
Grubauer, who made 21 saves, had stopped Miller on a breakaway late in the third to keep it a one-goal game at the time.
But Miller’s low shot in the waning seconds eluded the German-born netminder for the winning goal.
The Rangers had dropped two in a row, falling 3-2 to Minnesota on Friday following a 5-3 defeat at Columbus on Thursday. The Rangers squandered 2-0 leads in both defeats.
It was the first visit to Madison Square Garden for the Kraken, who had won two of three.
After beating the Kraken 3-1 in Seattle on Oct. 31, the Rangers had their only three-game losing streak of the season – with overtime defeats at Vancouver and Edmonton before a 6-0 defeat at Calgary on Nov. 6.
The Kraken fell to 5-12-2 on the road.
EXPANSION TEAM DEBUTS
Seattle became the 31st different franchise to play against the Rangers at Madison Square Garden. … Only the Winnipeg Jets (now the Arizona Coyotes) in 1979, the Tampa Bay Lightning (1992) and Mighty Ducks of Anaheim (1993) won their first road games against the Rangers as expansion teams.
STRONG AT HOME
The Rangers have won six out of seven games at home and have earned a point in 16 of their 20 home games this season. New York is 6-1-1 in its last eight home games.
Rangers: Host Florida Panthers on Tuesday before a two-week schedule break.
Kraken: Visit the Boston Bruins on Tuesday.
Source: Yahoo Sports