Neymar thrashed in from the edge of the box to break the deadlock for PSG after 73 frustrating minutes for the faithful at the Parc des Princes. Cavani then atoned for the penalty he missed just before half-time by guiding in his 17th goal of the season.
"'They didn't have their best day and they managed to score goals like that," PSG midfielder Marco Verratti told Canal+ after the match.
"They are great players and we're lucky to have them here. Neymar is one of the best players in the world and can do something good for the team at any moment. He scored a very important goal."
Until the breakthrough, Troyes had mirrored PSG's neat and tidy midfield passing patterns.
The visitors were also well organised in defence and appeared unafraid to rough up the expensively assembled troops bearing down on their goal.
The scars still smarted perhaps from when PSG destroyed them 9-0 in March 2016.
But Unai Emery's men found the November 2017 crop less amenable. Cavani botched his chance to open the scoring from the penalty spot after 41 minutes when the Troyes goalkeeper Mamadou Samassa dived to his right to parry the Uruguayan's penalty.
Cavani though had the last laugh securing the points when he scored for the seventh game on the trot.
Marseille rose to second in Ligue 1 with 31 points after cruising to a 3-0 victory at Metz. Rudi Garcia's team are unbeaten in 10 league games, while Lyon are third following their surprise defeat at home to Lille.
Thiago Mendes put the visitors in front mid way through the first-half. Minutes later Lyon were level. Mariano Diaz beat Lille goalkeeper Mike Maignan to Tanguy Ndombele's cross and headed in his 10th league goal since joining from Real Madrid in the summer. Ezequiel Ponce hit Lille's second just before half-time.
The hosts then squandered a chance to level early in the second-half when skipper Nabil Fekir missed a penalty. "It was an off day I think," he said. "There are no accidents in football. We didn't play a good match."
Lyon drop to third with 29 points and are ahead of champions Monaco on goal difference.
Last season's freescoring wonders appeared to be heading for a 0-0 draw at Nantes. But defender Lucas Lima drilled in spectacularly from the edge of the area in the third minute of added time to end a dismal sequence for the hosts and condemn Leonardo Jardim's men to a second consecutive Ligue 1 defeat following last weekend's 2-1 setback at home to PSG.
"It was important to score and to win after two defeats," said Nantes boss Claudio Ranieri. "These are three golden points against the champions."