The scores were tied 14-14 at halftime, but the Welsh side edged ahead in the second stanza, mainly as a result of the visitors' mistakes. The defeat also meant the end of the DHL Stormers' unbeaten run of 15 games.
Although they managed to score four tries, three via powerful lineout mauls, the Cape side made far too many unforced errors which allowed Cardiff to keep the scoreboard ticking over through the boot of flyhalf Rhys Priestland.
The experienced Welsh pivot controlled the game beautifully as he engineered two tries with precision cross-field kicks, while he also landed six penalty goals and a conversion.
The DHL Stormers initially struggled on the artificial pitch in the opening stages, making a few unforced errors and conceding two early penalties which Priestland easily turned into points.
He was also the architect of the game's first try when he launched a perfectly executed cross-field kick to left wing Theo Cabango who scored in the corner, and 16 minutes into the opening half the Cape side were 11-0 down.
But the visitors showed their potency on attack just minutes later when flanker Nama Xaba went over from a lineout maul, while Manie Libbok (flyhalf) made no mistake with the conversion to cut the deficit to 11-7.
The momentum was now in the DHL Stormers' favour, with Libbok starting to pull the strings. The No 10 delivered a beautiful deft kick to left wing Leolin Zas to score their second try of the evening.
Libbok also made no mistake with the conversion and the DHL Stormers were now 14-11 in the lead with 10 minutes to go until the break.
However, Cardiff tried to wrestle back control and they level matters with another penalty goal through Priestland after DHL Stormers No 8 Hacjivah Dayimani was yellow carded for making contact with the head in a tackle. That tied the halftime score at 14-14.
The second half started on the same note for the home side, with Priestland landing a perfect kick behind the DHL Stormers' defence allowing right wing Jason Harries to score their second try. The pivot easily converted to put his side 21-14 in front.
Xaba dotted down his second try from another powerful maul to make the score 21-19 after Libbok failed to land the conversion, but the visitors conceded another penalty straight after the restart, which Priestland steered over to hand his side a five-point lead at 24-19.
Loose forward replacement Junior Pokomela thought he had scored but he was held up over the line and minutes later he got his try through another successful lineout drive as the scores were once more tied at 24-24.
But Priestland had the last say, landing two late crucial penalty goals, one from right in front of the poles, as he steered Cardiff to a famous victory in front of a delighted home crowd.
Scorers:
Cardiff 30 (14) - Tries: Theo Cabango, Jason Harries. Conversion: Rhys Priestland. Penalty goals: Priestland (6).
DHL Stormers 24 (14) - Tries: Nama Xaba (2), Leolin Zas, Junior Pokomela. Conversions: Manie Libbok (2).