Rangers teammates crowd around Marian Gaborik after his hat trick gave New York a 4-3 overtime win over the Bruins.Photo: Anthony J. Causi

John Tortorella was acutely aware of the dangers before he did it, but he did it anyway.

Last night at the Garden, the Rangers coach trotted out a first line that might make most general managers blush, a group with such superlative talent they were utterly dominant for the majority of the time they were on the ice together in compiling a 4-3 overtime win over the Bruins.

But that group of Rick Nash, Brad Richards and Marian Gaborik can only play so much, and Gaborik’s hard-working hat trick — which included the game winner just 27 seconds into overtime — barely carried the Rangers above the sloppiness of the rest of the team, giving them their first win in the season’s opening three games.

“Your best players need to be your best players,” Tortorella said. “That line was really good at times, had some dips as our team did throughout the game, but Gabby came through big.

“It was a big game for him. He had struggled his first couple [games], but he played really well.”

Since joining the Rangers as a free agent in 2009, Gaborik has been both canonized and vilified, and some of that came from the mouth of Tortorella, as well. In hopes of creating a team identity based on hardness, sacrifice and aggression, there was no place for a player of Gaborik’s ilk, one who more often than not found himself on the outside of battles rather than in them.

“He has changed himself as a player since he got here,” Tortorella said. “He might not like me saying it, but he was a perimeter guy when he got here. He was a perimeter guy who did not want to practice because he was sore. He wasn’t injured.

“I think he has grown so much mentally in how he conducts himself,” the coach continued. “I’ll bet you 80 percent of his goals last year were from between five and seven feet by that net. So he is a very talented player that is willing to be there, and when I first met him, I didn’t think he was willing to be there.”

It was easier last night with the help of Nash and Richards, who both assisted on the first goal, 4:36 into the first. Just over two minutes later, Gaborik added another one after Nash crashed the net and the puck came to him on the far post, where he was set up just outside the crease.

“Richie knows how to slow the game down, he has good vision, and Nash just attracts players to him, he’s such a strong body and such a force to the net,” Gaborik said. “So I’m just trying to feed off those guys.”

After a slew of Rangers penalties — eventually totaling six minors — the Bruins managed to strangle back some momentum, taking advantage when Tortorella was trying to mix and match lines behind his top unit.

Besides the new mix of Taylor Pyatt, whom Tortorella called “one of their best players so far,” with Derek Stepan and Ryan Callahan, the bottom two lines became ineffective and began to see less and less ice time.

That culminated in Bruins’ forward Nathan Horton netting a low wrist shot through a screen with under five minutes left that tied the game 3-3 and sent it to overtime.

It was there, in a four-on-four, when Gaborik stole the puck and jammed it in to stop the bleeding — for now.

“We find a way to win a hockey game,” Tortorella said. “Is everything running on all cylinders? No. We have a lot of things we need to do, so we’ll continue to work at it. But it was nice to stop the bleeding.”