Gostisbehere one-timed a pass from Sebastian Aho at the right dot for the game winner.
With the Hurricanes' victory, Rod Brind’Amour became the fastest coach to 400 NHL wins and is 400-186-59 in his ninth season behind the bench.
Gostisbehere also tallied an assist, and Jackson Blake had a goal and an assist for the Hurricanes (22-4-3), who are 10-1-1 in their past 12 games. Brandon Bussi made 22 saves.
Nick Paul, Colton Sissons and Brandon Duhaime scored for the Maple Leafs (11-15-5), who are 3-1-2 in their past six games. Anthony Stolarz made 35 saves and Oliver Ekman-Larsson had two assists.
Paul’s power-play goal gave Toronto a 1-0 lead at 8:37 of the first period. He kept the puck on a 2-on-1 with Easton Cowan and scored on a wrist shot off Bussi’s glove.
Carolina answered with a power-play goal at 10:18 to tie the game at 1-1. Taylor Hall took a no-look cross-ice pass from Aho and scored on a one-timer in the right face-off circle.
Blake pushed it to 2-1 at 14:31 of the second period, snapping a shot from the top of the circles off a pass from K’Andre Miller's pass from the offensive goal line.
Sissons tied it 2-2 at 17:08 when he gathered a pass from Cowan in the neutral zone before scoring over Bussi’s right pad on a breakaway.
Duhaime scored to give Toronto a 3-2 lead at 7:07 of the third period with a snap shot from the bottom of the left circle that slipped under Bussi’s right pad.
Martinook scored at 12:40 to tie the game at 3-3. Jaccob Slavin’s shot went wide of the net but deflected off Martinook’s back and over Stolarz’s right shoulder.