Nash scored 2:01 into overtime for his third goal of the game, lifting the Rangers to a 5-4 victory over the Panthers on Saturday night.
Nash's winning goal came on the power play when his wrist shot from the right circle got past Luongo to give the Rangers their seventh straight win against the Panthers — and fourth straight against Florida goalie Roberto Luongo.
"I knew (Mats Zuccarello) was in front and I could get it through the defenseman's legs," Nash said. "I just shot it and hoped for the best."
Nash's hat trick was his career seventh and second for the Rangers.
Zuccarello and Viktor Stalberg each scored in the third period to put the Rangers ahead 4-2. Henrik Lundqvist made 39 saves as New York bounced back after a loss at Tampa Bay on Thursday night snapped its nine-game winning streak.
"We thought we gave away a point on the road (at Tampa Bay)," Nash said. "You want to lock things down. After tonight, I think we'll take it the way we got it."
Jaromir Jagr, Aleksander Barkov, Jussi Jokinen and Nick Bjugstad scored for the Panthers. Luongo stopped 26 shots.
Down two goals, the Panthers scored twice in a 39-second span late in the third period to send the game into overtime.
Barkov's power-play goal pulled Florida to 4-3 with 2:28 left, and Jagr then sent a shot from the right circle over Lundqvist's shoulder with 1:49 to go. Both goals came as the Panthers played with an empty net.
"How many times does it happen, you pull the goalie, you score two goals? It was a great call by our coach to pull him with a lot of time," Jagr said. "I feel like we played good enough to win."
Reilly Smith missed a penalty shot for Florida with 1:42 left when his shot went high.
"There was no quit," Panthers coach Gerard Gallant said. "I was really proud of our guys tonight because we played one of the fastest teams in the league and we kept up with them and we probably pushed the pace more than they did tonight."
Zuccarello put the Rangers ahead 3-2 when he came on a breakaway and put the puck past Luongo with 9:44 to go in the third. Stalberg stretched the lead to 4-2 when he beat Luongo from low in the right circle on the short side nearly 2 minutes later.
"Our goaltender kept us in it," Rangers coach Alain Vigneault said. "He gave us an unreal performance, and there's no doubt Nash played one of his better games this year."
Nash gave the Rangers a 1-0 lead when his shot from below the right circle got past Luongo's glove and went high into the net with 8:52 left in the first period.
Bjugstad tied it at 6:46 of the second as Pirri passed from the left circle to Bjugstad in front and he put the puck underneath Lundqvist's pads.
Nash's second goal put the Rangers ahead 2-1 when he brought the puck from his own end and his shot from the left circle beat Luongo on the short side with 6:38 to go in the second.
The Panthers tied it again when Jokinen, in front of the crease, tipped in a shot from the right circle by Brandon Pirri with 2:03 left in the second.
Earlier in the second, Lundqvist took a puck to the groin area on a shot by Bjugstad at 3:28 and took several minutes to recover.
Chris Kreider had a penalty shot with 6:15 left in the first when he was hooked by Aaron Ekblad. Kreider shot from low in the right circle but Luongo turned it aside with his blocker. According to information provided by the team from the Elias Sports Bureau, Kreider — who had an unsuccessful penalty shot in the third period on Thursday at Tampa — is the first player in Rangers history to have a penalty shot in back-to-back games. The last player in the NHL to have penalty shots in consecutive games was Marian Hossa in 2005 for Atlanta.
NOTES: Rangers D Dan Girardi tied James Patrick for 13th place on the Rangers' all-time games played list and tied Patrick for the fifth-most career games played by a defenseman in franchise history. ... Jagr is now one goal away from tying Marcel Dionne for fourth all-time in goals (731).Panthers D Dmitry Kulikov is out for two to four weeks with a leg injury.