PSG trailed twice and had looked destined for a first defeat to their fierce rivals since November 2011 - with Neymar sent off for two bookable offences – before Cavani curled a dramatic late free-kick into the top corner to rescue a point.
Marseille led through Luiz Gustavo in the first half, before Neymar equalised, and then again moved in front when Florian Thauvin lit up a dreary second half.
But the greatest drama was still to come as Neymar - who had been jeered throughout and endured a host of missiles from the home supporters at one point - clashed with Lucas Ocampos moments after his first booking and received his marching orders.
Bouna Sarr squandered an opportunity to seal the points for Marseille and that would prove costly as Cavani - fouled by the substitute - netted a stunning strike to break Marseille hearts.
Cavani and Neymar have not always seen eye to eye this term, with the pair infamously arguing over penalty duties, but it was the Uruguayan's set-piece expertise that ensured his team-mate's indiscipline would not prove costly.
Layvin Kurzawa squandered the first huge opportunity of the night, blasting high over the crossbar after benefiting from a fortunate ricochet as Adil Rami stepped across to challenge on the left-side of the area.
A frantic pace contributed to a series of early stray passes from both sides and one such Hiroki Sakai error gave Cavani the opportunity to curl a low effort into Steve Mandanda's grateful arms.
But the opener arrived at the other end after Neymar's uncharacteristically poor first touch gifted possession to Rami. Dimitri Payet moved the ball square to Luiz Gustavo, who drove forward to arrow a magnificent strike into the bottom-left corner of Alphonse Areola's goal.
PSG's response should have been immediate, but Cavani contrived to blaze a seemingly simple close-range finish high and wide.
Neymar atoned for his earlier mistake after 33 minutes, however. Adrien Rabiot drew defenders away from the former Barcelona star and then slipped a pass back into his path for a precise left-footed shot that clipped the base of the right-hand post on its way in.
Rudi Garcia and Marseille could only have been pleased with their first-half play - despite the equaliser - but PSG assumed complete control after the restart.
Clear-cut openings were few and far between, though, and the first incident of note in the second period saw a delay as Neymar refused to take a corner as objects thrown from the stands rained down on that part of the pitch – the Brazilian eventually sending the ball in as riot police protected him with shields.
And, with PSG's threat apparently fading, Thauvin struck. Substitute Clinton N'Jie crossed from the right and the former Newcastle United man nipped in front of Thiago Silva to prod into the net, sparking scenes of wild celebration.
PSG were dealt a further blow when Neymar pushed Ocampos to the ground - aided by an exaggerated fall - and Sarr could have sealed victory when he ran clear and shot at the legs of Areola.
1 - Neymar is the 1st scorer to be sent off in a L1 game between Marseille & Paris in the last 25 seasons. Rare. pic.twitter.com/P6hUTqnsCr— OptaJean (@OptaJean) October 22, 2017
There was one last chance for the visitors, though, and Cavani made it count. Stepping up to take a free-kick in what normally would have been considered to be Neymar's territory, the forward struck gold and stunned the Velodrome into silence.
Key Opta Facts:
- Paris Saint-Germain are unbeaten in their last 15 competitive games against Marseille (W12, D3). Their last defeat came on 27 November 2011 (3-0 at the Vélodrome). This is their longest unbeaten run against their fierce rivals.
- Marseille have registered 18 points after 10 games in Ligue 1, their highest tally at this stage since 2014/15 (25) - when they finished fourth.
- PSG have only lost once in their last 30 Ligue 1 games (W24, D5), to Nice on 30 April 2017 (1-3).
- Unai Emery's side have scored 31 goals after 10 Ligue 1 games in 2017/18, their highest tally ever and the highest since St Etienne in 1970/71 (37).
- Edinson Cavani has scored in three of his last four competitive games against Marseille.
- Neymar is the third player to score in a league game between Paris and Marseille and in a league game between Barcelona and Real Madrid in the 21st century after Ronaldinho and Zlatan Ibrahimovic.