The result also provided a much-needed boost in confidence following Wednesday's 3-1 loss to Madrid in the first leg of their last-16 Champions League tie.
While there is still a second leg to come on home soil, Cavani felt it was crucial PSG showed a "good reaction" after what happened to them at the Santiago Bernabeu.
"We had to win to change our minds, what happened happened, so we had to look forward, and we had to think about the other goal of the championship," the striker told Canal+.
"It was a good reaction. Against Real, there are 90 minutes left and then there are also the other competitions.
"We were tense after the Real game, but that's normal. You have to leave all that behind, you have to keep working, stay together and work as a team.
"The only way to get right is to stay together and then we can win important things. In difficult times, we must remain in solidarity."
Julian Draxler, Neymar and Angel Di Maria also found the net for PSG, who are next in action against rivals Marseille in Le Classique next weekend.