RALEIGH, N.C. — By now, Morgan Geekie knows he is a dangerous NHL goal scorer. He leads the Boston Bruins in this category. This is not easy when David Pastrnak is a teammate.

But before Geekie recorded a hat trick in Tuesday’s 6-5 overtime loss to the Carolina Hurricanes, he had been parked on 34 goals for 17 straight games. This would do a number on anyone. It is a long time for a puck not to go in. Confidence, in such situations, can be a fleeting commodity.

“We need him,” coach Marco Sturm said. “We don’t need Morgan Geekie to be down. It doesn’t matter if he’s scoring or not. Hopefully that helps him moving forward.”

It does not really matter that the Bruins went 0-2-2 on their road trip. They are 6 points clear of the Columbus Blue Jackets, the ninth-place team in the Eastern Conference.

What matters is that Geekie is back to feeling like himself heading into the playoffs.

“It’s always nice,” Geekie said of breaking his slump. “But on days like today, it doesn’t really mean anything. Sure, mentally, I guess. But it feels like you come in here, it doesn’t matter if you scored six goals. Just one of those things where losses like that are tough to swallow for sure.”

Geekie has a lot going for him. He is in the first season of a six-year, $33 million contract. He knows he is not just along for the ride with Pastrnak.

But going more than a month without doing what he’s being paid for got in Geekie’s head. It didn’t surprise his coach. Nobody can shut out all the noise.

“He hears it every day,” Sturm said. “He’s an NHL player. It doesn’t just go by you. Of course he’s thinking about that. I’m glad he stopped that.”

There have been games within this segment when Geekie wasn’t fulfilling the requirements of being a goal scorer. He was drifting to the perimeter. He was behind the play. He was not taking advantage of his shot.

But Pastrnak could see it coming, even during Sunday’s 2-1 overtime loss to the Philadelphia Flyers, when he was reunited with Geekie and Elias Lindholm on the No. 1 line.

“He was really good,” Pastrnak said of his first-line left wing. “He was around it. He was really direct and shooting. When you play like that game like he had in Philly, there’s going to be more nights than not you’re going to score, you’re going to have looks. Good on him. You could see it in Philly. He could have scored already but he didn’t. Today, it paid off. He’s direct. He’s always around the net. He scores a lot of goals around there.”

Pastrnak, as he usually does, had a hand in bringing Geekie back to life.

Boston Bruins center Morgan Geekie bumps teammates' fists after scoring.

Morgan Geekie’s 37 goals are four more than his career high entering the season. (James Guillory / Imagn Images)

The No. 1 right wing has developed into an exquisite playmaker, partly because of the shooting threat Geekie has become. Over the last two seasons, Geekie has usually been Pastrnak’s first look. Geekie is not just good at getting open. He knows what Pastrnak likes to do and how to respond.

Case in point: In the first period, when Pastrnak carried the puck down the left side, he knew what Geekie would do. He was going to park himself between the dots. A player with his degree of shot can make that a comfortable office. So even though Pastrnak missed with his first shot, he found his rebound and backhanded the puck to Geekie. He didn’t miss.

“A lot of players can swing away. But he stopped in the slot,” Pastrnak said. “I was able to see him. He’s that open, you want to give him that puck.”

Less than four minutes later, Geekie improved his position even more. Instead of staying between the dots, Geekie went to the lip of the crease just as Pastrnak carried the puck to the strongside post. From that distance, it is a slam dunk for Geekie to score. The Hurricanes challenged the goal for goalie interference, claiming Pastrnak jostled Brandon Bussi, but video review upheld Geekie’s goal.

The No. 1 left wing completed the hat trick late in the second period. Jordan Staal, Carolina’s top matchup center, was all over Geekie in front of the net. But when Nikita Zadorov snapped a puck on goal, Geekie got his stick loose just in time to deflect the puck past Bussi.

“I knew Z was going to shoot. I was just trying to time it if I could get it loose,” Geekie said of his stick. “He’s obviously a great defensive player. Just tried my best to get it loose for a split second. He had me tied up pretty good around the net. I was lucky to get a stick on that one.”

It was perhaps the only highlight of the period. The Hurricanes, who scored twice in the first, pumped three straight pucks past Jeremy Swayman in the second. It prompted Sturm to hook Swayman after Carolina made it a 5-3 game. The ace was not at his best.

“We just totally lost control in that second period,” said Sturm, whose team was outshot 15-9. “Started with a bad penalty. Didn’t clear the puck on the PK. Just did a lot of bad things out there. It’s playoff hockey out there. You cannot play like this. We just didn’t really understand that.”

Joonas Korpisalo stopped every shot he saw except Jaccob Slavin’s back-door overtime winner. He kept the Bruins alive.

Meanwhile, Pavel Zacha made it a 5-5 score in the third with his 30th goal. The Bruins got a point. Geekie is back. The trip is over.

They’ll take all of it.