Torino, who have now lost their last four games, had the better of the match from start to finish, hitting the post twice before Higuain broke their hearts in the last minute.
The win handed Napoli a 10-point advantage over fourth-placed Fiorentina, taking them closer to a Champions League berth and keeping them in the hunt for a second-place finish which would spare them a play-off in August.
Torino coach Giampiero Ventura boldly chose to leave both Alessio Cerci and Ciro Immobile on the bench after a barren run, putting his faith instead in Riccardo Meggiorini and Paulo Barreto.
It seemed to be the right choice too as the Granata attack posed a greater threat than in recent weeks, when they had failed to score in three games.
Meggiorini missed the target before fizzing his next effort straight at Jose Reina. Cesare Bovo then struck the outside of the right-hand post with Reina beaten on the half-hour mark.
There was little coming from Napoli's attack until Higuain nearly got in early in the second half, shooting straight at Daniele Padelli with only his second chance of the evening.
A minute later, Meggiorini found a way through, but only hit the outside of the left-hand post with his shot.
Matteo Darmian's shot from 20 yards was subsequently tipped over as Torino continued to threaten an opening goal.
Immobile came on for the final 25 minutes and contrived to waste the best chance of the night. He received the ball from Jasmin Kurtic, but, with time on his hands, he shot first time and lifted the ball over from 10 yards out.
It proved to be a costly miss as Napoli snatched victory in the last minute.
Higuain left his marker on the ground as he raced into the penalty area, controlled the ball and fired through Padelli, who did not get enough on the shot to keep it out.
It was a cruel ending for Torino, but a vital win for Napoli.