The Portuguese had surged from 11th on the grid to factor into the leading battle, taking the lead from Nick Cassidy on the 24th lap with a brave outside pass in the flat-out Turn 8 before motoring off into the distance.
With enough of a lead to take his second and final attack mode, da Costa missed one of the three activation loops and haemorrhaged part of his lead to the chasing Vergne, still with a minute of 350kW left to take.
Two laps later, da Costa went again and this time came up for air with attack mode successfully triggered, but Vergne swept into the lead in his bid to win a second race on the bounce.
The Porsche driver did not give up the fight, looming large in Vergne's mirrors over the final laps and using the slipstream to get level on energy with his former DS Techeetah team-mate.
On the first of the two added laps, da Costa managed to complete a carbon copy of his move on Cassidy and swept into the lead to enthral the sell-out Cape Town crowd.
It was a matter of closing out the race from there and, once da Costa had warded off Vergne at Turn 10 at the end of the beachfront stretch, the 2019-20 champion could cross the line for a famous victory.
Da Costa and Vergne had moved up into the top three following Maximilian Guenther's lap 21 crash as he hit the wall at Turn 1. As the Maserati MSG driver pulled up to stop, a full-course yellow period was introduced just as the leading pair of Cassidy and Sacha Fenestraz collected attack mode.
While Cassidy held on, Fenestraz lost positions to da Costa and Vergne at the introduction of the short yellow-flag period while Guenther's car was cleared from the Turn 4/5 chicane run-off.
This opened the door for da Costa to continue his compelling charge through the field, with Cassidy falling to his gutsy move.
Vergne was effusive in his praise of da Costa's move, and had to be content with second despite his attempts to find a way past on the final lap.
Cassidy completed the podium after leading most of the final two-thirds of the race, and although the New Zealander fell behind polesitter Sacha Fenestraz, the Franco-Argentine driver crashed on the final lap to allow Cassidy to claim a second podium on the bounce.
More to follow
Cape Town E-Prix Results:
Source: Autosport