Two legends, and both of them want the reigns.

Wayne Gretzky and Mark Messier are both interested in taking over for John Tortorella as the next coach of the Rangers, The Post has confirmed. After Tortorella was fired on Wednesday, a slew of possible candidates have arisen from both inside and outside the organization. Messier was the one name being mentioned that didn’t have a day of professional head coaching experience, while Gretzky hasn’t coached since he was behind the Coyotes’ bench in 2009.

As originally reported by Canadian outlet SportsNet, Messier wants this to be his first head-coaching job in either the AHL or NHL. The sole coaching experience for the 52-year-old is with Team Canada during the 2010 Deutschland Cup and the 2010 Spengler Cup. He was also the general manager for Canada during the 2010 World Championships in Germany.

Gretzky bought a part-ownership stake in the Coyotes in 2001, two years after finishing what most consider the best career of all time with a three-season stint for the Rangers. He took over behind the bench in Phoenix in 2005, and couldn’t get them to the playoffs in four straight seasons before giving up the role.

It is unsure if either Messier or Gretzky have made their wants clear to Rangers general manager Glen Sather, who is expected to begin the interviewing process at the organization’s annual meeting in late June in La Quinta, Calif. The team has also received permission to speak to former Canucks coach Alain Vigneault, as well as Toronto Marlies (AHL) coach Dallas Eakins. Another name high on the list would be former Sabres coach Lindy Ruff, but it’s unsure if the Blueshirts have obtained permission to bring him in for an interview.

Both the Stars and Canucks are still looking for coaches, as well, and it would seem that they might be more inclined to have a coach with NHL or AHL experience.

Although Messier doesn’t have any of that, in August of 2009 Sather hired him as a special assistant, a role that kept Messier involved in the team’s operations. He was approached by Sather for the head coaching role in 2002 while with his second run with the team as a player, but he declined and went on to play through the 2003-04 season.

Last season Messier was reached out to for the coaching vacancy in Edmonton after former Rangers coach Tom Renney was fired, yet he declined the offer because of his desire to stay in New York.

Sather, Messier and Gretzky can all trace their roots back to Edmonton together, where the three of them won four Stanley Cups in the late-1980s with Sather as coach and Messier and Gretzky as the leading players.

Gretzky was then traded to the Los Angeles Kings in 1988, while Messier went on to win another Cup in Edmonton in 1989-90 once Sather retreated back to being just general manager.

In 1991, frustrated with Edmonton management, Messier demanded a trade and was sent to the Rangers in exchange for Louie DeBrusk, Bernie Nicholls and Steven Rice.

Then in 1994, Messier became a franchise legend unlike any other. He guaranteed a victory in Game 6 of the Eastern Conference finals against the Devils, and backed it up with a hat trick. He then scored the Cup-winning goal in the finals against the Canucks, breaking a 54-year championship drought and giving the Rangers their first Stanley Cup since 1940.

In 1996-97, Messier and Gretzky were reunited for one season with the Rangers. The following season, Messier started a three-year stint with the Canucks, before returning in 2000 and finishing his career a Ranger in 2004.

Gretzky played the final game of his illustrious career at the Garden on April 18, 1999, a 2-1 overtime loss to the Penguins.