Having center Derick Brassard bust out offensively after a flu and sinus infection that kept him pointless in five games was the remedy that he and the Rangers needed.

“We knew it was only a matter of time,” Ryan McDonagh said after Brassard scored four of his career-high five points in a wild third period to help carry the Rangers to a 6-3 victory over the Sabres on Monday night at Madison Square Garden.

The bounceback win after a 3-0 loss to Ottawa kept the Blueshirts (27-17-5, 59 points) in second place in the Metropolitan Division before the All-Star break, three points ahead of the Islanders.

“I’ve been kind of struggling the last two weeks,” said Brassard, who leads the team in points with 36. “I found some offense, so hopefully that’s going to give me some confidence.”

The result didn’t come easily, as the Rangers fumbled away a 3-1 lead in the third. Starting at 4:31, forward Zemgus Girgensons, who didn’t play the previous four games, scored twice in a span of 1:13. He pulled the Sabres into a tie with the second goal on a backhander over Henrik Lundqvist’s left pad on a rush.

“You get a little frustrated but you understand there’s plenty of time left in the game and you’ve got to find a way to recapture some momentum,” McDonagh said. “And one or two shifts after that, J.T. [Miller] gets that goal. Brassard makes a good read, picks off a pass and those two go up ice together.”

advertisement | advertise on newsday

With his fifth goal in six games, Miller gave the Rangers a 4-3 edge and Mats Zuccarello slammed in a power-play goal on a give-and-back from Derek Stepan at 9:23. The Rangers were 1-for-34 on the power play before Zuccarello’s fifth man-advantage score of the season. Brassard added an empty-netter at 19:24.

“Great to see him break through here,” McDonagh said of Brassard. “He knows he’s a big impact player for us, in a lot of different situations. When he and Zukie are feeling it, finding plays, finding seams, they’re a tough combo to stop.’’

In the five-goal third period, Jesper Fast, one of the few solid players in the loss at Ottawa, found Brassard in front with a pass from the left side. The puck hit the center’s right skate and deflected past Chad Johnson at 1:06 for a 3-1 lead.

Viktor Stalberg, with his seventh goal, had given the Rangers a 2-1 advantage in the second. Kevin Hayes carried the puck into the zone and Marcus Foligno poked it away from behind. But it went toward Stalberg, who spun, and while falling sent the puck past Johnson at 14:51.

In the first period, the Blueshirts came out of the tunnel as if they had received Alain Vigneault’s harsh message about Sunday’s no-show loss. They came up with a strong five-plus minutes of chances, including an early power play. Finally, the Rangers got on the board at 5:58, when Dylan McIlrath’s shot from the left circle went through Miller’s screen, hitting Rasmus Ristolainen’s stick before going past Johnson.

But McIlrath’s second career goal was all the Rangers would get in the period, as the Sabres tried to fight back.