Trailing to Craig Duff's seventh minute opener for the visitors the Gate were still desperately trying to find a way back when the game turned on its head in first-half stoppage time.
First Freddie Ladapo cut the ball back for Danny Green to equalise and then, in a reversal of roles, the scorer turned provider with the pass that teed-up Ladapo to make it 2-1.
Further goals from substitute Brett Johnson and Jamie Taylor made victory safe but the gloss was taken off the win on 79 minutes when substitute Charlie Allen was sent off, just 90 seconds after coming on, for a bad challenge on Dan Green.
The win was Margate's first in eight games in front of their own fans this season, and ended a run of five straight defeats at Hartsdown.
Manager Terry Brown stuck by the team which was beaten 2-0 at home by Weston the previous weekend which meant there was no place in the starting line-up for Allen, who re-signed on a short term deal last week.
The Truro side meanwhile showed several changes from that drew 1-1 at Hartsdown on the opening day of the Vanarama National League South season.
The most notable absentee was suspended striker Isaac Vassell - cousin of former Aston Villa and England forward Darius - who had terrorised the Gate defence back on that day back in August. They were also without new signing Jamie Reid whose loan club Exeter City do not want him to be cup-tied.
After all those successive home defeats Gate unsurprisingly began nervously and from the game's first corner, after two minutes, striker Ladapo miskicked towards his own goal.
They fell behind in the eighth minute when Truro midfielder Dan Green burst into the box before picking out Craig Duff who curled a shot beyond Nikki Bull and into the corner.
Gate created their first chance on 14 minutes when Truro keeper Martin Rice smothered from Kane Wills at the far post and soon after Danny Green sent a shot wide.
Luke Moore then had a low centre held by Rice and as the Gate stepped up the tempo, Rice had to punch clear from Ladapo who then rounded the keeper but his shot lacked conviction and was easily cleared.
Truro scorer Duff could have doubled his tally in the 32nd minute but blazed over after Matt Wright's flick had put him in behind the Gate defence.
That miss came back to haunt Truro as the half reached its conclusion, with Danny Green and Ladapo the men who masterminded the Gate's recovery.
First Ladapo cut the ball back for Green to side foot home from eight yards and with the half in stoppage time, Green returned the favour with a pass that put Ladapo in on goal.
His first attempt was smothered by Rice but he reacted smartly to lob the rebound home.
Truro had an early second half chance when Duff got in at the far post but Charlie Wassmer took the pace off his shot enabling Bull to palm the ball away.
Moore then fired wide for Gate before they increased their lead just after the hour following a handling error by Truro keeper Rice. He failed to deal with a left-wing corner and Johnson was on hand to head home.
As their confidence grew Gate created further chances to extend their advantage with Rice turning aside Moore's fierce low drive before blocking from Ladapo at his near post.
Glenn Wilson also had a header blocked at the far post with central defensive partner Wassmer sending another header over.
Allen entered the fray on 77 minutes but just two minutes later was heading for the changing rooms after a bad lunge on Green.
The Gate though weren't finished and with three minutes remaining made it 4-1 when Ladapo's low cross was turned home at the far post by Taylor.