A chaotic first half ended 17-17 as Cameron Winnett, James Botham and, most spectacularly, Theo Cabango scored tries for Cardiff, with Danny Care and Marcus Smith crossing for Quins.
The English champions' deeper resources eventually told as Alex Dombrandt and Joe Marchant touched down.
Dombrandt then scored a second before Andre Esterhuizen crashed over.
The teams were level until the 58th minute but, once they had to turn to their respective benches, there was no compensating for the gulf in resources between the full-strength Quins and a cobbled-together Cardiff side.
As they were for the previous weekend's opening defeat against holders Toulouse, Cardiff had 32 players still missing after quarantining following the trip to South Africa, with another 10 out through injury and suspension.
Their team at the Stoop was therefore another makeshift collection of academy players, semi-professionals and the handful of Wales internationals who had not made the trip to South Africa.
And as they did against Toulouse, Cardiff's self-styled "misfits" started superbly to take an unexpected early lead.
From a line-out in the Harlequins 22, the visitors swept through attacking phases and spread the ball to the right wing, where 18-year-old full-back Winnett dummied and sped over for a converted try five minutes into his senior debut.
The advantage was short-lived as Quins responded with a flowing move of their own, which Care finished to bring his team level.
Even with Wales wing Josh Adams sent to the sin-bin for a dangerous tackle on Tyrone Green, Cardiff hit back as all-action flanker Botham burrowed his way through for their second try.
The game was played at a breathless pace and less than 20 minutes had been played by the time the fourth try arrived, a spectacular effort from Smith.
The England fly-half lit the fuse for the attack as he broke from his own half, offloaded to Dombrandt and received a return pass before cantering under the posts for a score he converted to put Harlequins 14-12 up.
Smith then kicked a penalty to extend Quins' lead but back came Cardiff with another spectacular score. Just inside his own half, captain Ellis Jenkins stole possession at a ruck before lock Seb Davies drew in two tacklers, freed his arms and popped the ball to Cabango, who scorched clear down the left wing, beat three defenders and touched down.