What a way to go out. What incentive to stay.

In what might end up being his farewell National Hockey League game, the New Jersey Devils‘ all-time scoring leader tacked on three more points to his legend for good measure.

On April 9, four days before his 40th birthday, Patrik Elias scored a goal, set up two others and was a plus-4 in New Jersey’s season-ending victory over the Toronto Maple Leafs. A meaningless game stuffed with so much significance for Elias, whose hobbled joint limited him to a scant 16 games in 2015-16.

One week earlier, the franchise’s pace-setter in goals (408), assists (617) and points (1,025) believed he was done, but his three-game return from January’s arthroscopic right-knee surgery re-energized him, as did striking instant chemistry with fellow Czech forward Pavel Zacha — a player half his age making his NHL debut.

“I couldn’t write it better,” Elias told Scott Oake afterward (watch above). “The way I felt these three games, hopefully this is not it, but you never know.”

What we do know, after Elias underwent yet another surgical procedure on his right knee in early May, is that the unrestricted free agent will be taking Teemu Selanne’s late-career approach to free agency this summer.

July 1 means nothing to the two-time Stanley Cup winner, who will either retire late this summer or sign a one-year contract with the Devils — the club that drafted him 22 years ago.

“He desperately wants to play one more year,” Elias’s agent, Allan Walsh, told Sportsnet. “We’re not talking to other teams. If Patrik is able to play at the level he expects himself to play, if he can contribute to a team, I think New Jersey would very much love to have him back.”

Elias’s latest surgery went well and he has begun specific rehab protocols. He will take time to rest and ramp up his training through the summer and start skating in August. If his knee feels strong and Elias believes he can contribute on a nightly basis to the Devils, only then will he and Walsh open discussions with New Jersey.

Remember when Devils icon Martin Brodeur retired as a member of the St. Louis Blues?

OK. Done cringing?

Well, as eager as he is to return, don’t expect Elias to join one of the NHL’s other 29 teams in 2016-17.

“I would say it’s a similar situation to what Teemu Selanne went through with Anaheim for several years,” Walsh explained. “When he felt his knee would hold up and he felt good, he told Anaheim, ‘I’m ready to commit to another year.’ And then they worked out a deal.”

Devils GM Ray Shero, too, must be certain Elias is healthy, especially when one considers the injuries that have plagued veteran Devils forwards Michael Cammalleri (signed through 2018-19) and Ryane Clowe (2017-18). Each of those players is costing the team roughly $5 million per season.

Selanne played until age 43. Jaromir Jagr just signed on for another tour with the Florida Panthers at age 44. Look no further than the Stanley Cup Final to see aging San Jose Sharks Joe Thornton and Patrick Marleau, both 36, and Dainius Zubrus, 37, making an impact on the West’s best team.

“He certainly looks around the league at some of the guys. Even his good friend Zubrus, who’s playing really well with San Jose right now,” Walsh said. “Patrik is very motivated to get to the point where he can be an effective player.”

Here’s hoping Elias goes full Selanne and announces one more season with a goofy video.