Hwang Ui-jo gave Bordeaux a surprise lead before Cavani equalised for PSG with his landmark strike at the Parc des Princes.
The hosts went ahead when Marquinhos chested the ball home but Bordeaux levelled through Pablo following a mistake by PSG goalkeeper Sergio Rico.
Marquinhos and Kylian Mbappe both finished clinically to put Thomas Tuchel's side in command, although Ruben Pardo reduced the deficit to set up a tense finish and Neymar was dismissed for a second booking late on.
PSG captain Thiago Silva limped out with an injury in the 17th minute and without the Brazil defender's presence the home side conceded a minute later.
Toma Basic's high corner picked out Hwang and the South Korean headed past Rico, who had been selected ahead of Keylor Navas.
PSG equalised shortly afterwards when Angel Di Maria's curling cross found Cavani and he powerfully headed home.
Di Maria was the provider again, this time from a free-kick in first-half injury time, when he teased a ball into the box for Marquinhos who bundled in with his chest from close range.
However, Bordeaux drew level in the second minute of added time after Rico's attempted clearance rebounded off Pablo and rolled over the line.
There was no let-up in the action after the break in an enthralling contest, Marquinhos giving his side a 3-2 lead when he stabbed home from close range following Mbappe's cutback after Bordeaux switched off following a corner.
Mbappe then got his name on the scoresheet when PSG stole possession and he slotted home after being set up by Cavani.
In a thrilling climax to the game, Pardo's stunning strike from the edge of the box reduced the arrears before substitute Mauro Icardi thought he had scored PSG's fifth only for VAR to deem it to be offside.
Brazil forward Neymar was then dismissed when he was shown a second yellow card for a reckless challenge on Yacine Adli.
What does it mean? Party antics catch up with PSG
Tuchel was less than impressed with his players after videos of them enjoying a raucous party to celebrate the birthdays of Icardi, Cavani and Di Maria appeared on social media in the days after a 2-1 defeat to Borussia Dortmund in the Champions League last 16.
PSG were far from at their best here, and looked vulnerable defensively, but they gave the home fans at least something to cheer with some swaggering play going forward in a chaotic win that strengthened their grip on top spot in Ligue 1.
Classic Cavani still has plenty to offer
An all-action display, a standing ovation, a trademark headed goal and an assist. It was almost as if Cavani had a point to prove to Tuchel from the moment he stepped on the pitch.
The experienced Uruguayan may leave PSG when his contract expires at the end of the season, but is far from finished.
200 – Edinson Cavani has scored his 200th goal with Paris in all competitions (298 games played).— OptaJean (@OptaJean) February 23, 2020
138 in Ligue 1, 30 in Champions League, 32 in Domestic Cups.
187 inside the box/13 outside the box.
151 from open play/49 from set plays.
Matador. #PSGFCGB pic.twitter.com/lbLtUn9keg
Rusty Rico not reliable
Handed his second Ligue 1 start of the season in the 26-year-old Spaniard had a shaky game between the sticks for PSG.
He was rooted to his line for Bordeaux's opener, and made a terrible error for their second goal.
PSG have a home game against struggling Dijon in Ligue 1 next Saturday, while Bordeaux host Nice the following day.