The Dolphins were chasing 253 on the final day to win a thrilling match in which batting collapses after big partnerships were the order of the day.
But a wonderful spell of lively swing bowling by Travis Muller had them deep in trouble from the outset.
Muller swung the ball late and both ways to take five for 21 in nine overs, reducing the Dolphins to 60 for seven.
Piedt then wrapped up the tail, finishing the match with a hat-trick and superb figures of five for 16 in 4.4 overs.
Keshav Maharaj was bowled through the gate by a big-turning off-break for eight and then Mthokozisi Shezi and Craig Alexander both picked out fielders with aggressive strokes.
The Cobras are now back on top of the Sunfoil Series log, nearly 14 points ahead of the second-placed Highveld Lions, but they began the day in disappointing fashion as they were bowled out for 280 in their second innings, having lost their last nine wickets for 87 runs.
Fast bowler Kyle Abbott was once again the destroyer, taking seven for 65 to give him 12 for 125 in the match, and the national selectors are obviously going to have to seriously consider him for the Newlands Test between South Africa and Australia in the probable absence of Wayne Parnell.
Justin Ontong’s gritty knock of 150 was largely responsible for the Cobras’ first innings of 304 and their bowlers showed similar determination in fighting back to bowl the Dolphins out for 332 when they had been 304 for four.
Andrew Puttick (123) and Stiaan van Zyl (99) then combined for a second-wicket stand of 187 for the Cobras and, despite the Abbott-induced collapse, the lead of 252 was way too much for the Dolphins.
Openers Divan van Wyk (18) and Imraan Khan (21), and captain Morne van Wyk (19 not out) were the only batsmen to reach double figures for the Dolphins as Muller and Piedt formed a formidable duo for the Cobras.