It was an inauspicious start to Cobras’ second-innings - Andrew Puttick and Omphile Ramela were both rapped on the pads by Viljoen without scoring.
But Viljoen had not finished wreaking havoc on the visitors’ top order.
Stiaan van Zyl wafted at a rising delivery, and the resultant edge found the hands of Dominic Hendricks at second slip.
The Cape-based side were deep in the mire on eight for three and Viljoen’s figures reading at that time 2.2-0-2-3.
But the rot had well-and-truly set in.
Viljoen, with his tail up, induced Zubayr Hanza to fish outside his off-stump, edged it and the Lions captain took the catch at first slip.
The visitors were holding on by their fingernails on 17 for four and still needing 35 runs to knock off the deficit.
Jason Smith and Dane Vilas set about trying to restore the innings, but to no avail.
The 18-year old Wiaan Mulder, who hit his straps in the Cobras’ first-innings taking three wickets for only 10 runs, struck Vilas on the pads and the batsman was adjudged to be lbw. A visibly dejected Vilas showed his displeasure at the umpire’s decision.
The Cobras, with their heads barely above water, were 42 for five and still needing 10 runs to make their hosts bat again.
Aviwe Mgijima, on six at the interval, added just three runs before prodding tentatively to a Mulder out-swinger, found the outside edge and saw the ball fly straight into the hands of the keeper Mangaliso Mosehle.
The visitors: 96 for six.
Three overs later, Viljoen claimed his fifth scalp when he crashed through Vernon Philander's defence and rearranged the woodwork.
Viljoen finished with 6-75 and the 18-year old Wiaan Mulder - in matric this year - with 4-54.