The Town had dominated possession and Matty Pearson deservedly headed them level in the 86th minute after Aden Flint had put the hosts in front soon into the second half.
But it was Vassell - signed from Birmingham City on transfer deadline day after being linked with a return to Kenilworth Road - who had the final say, rising to meet fellow substitute Junior Hoilett's 95th-minute cross and seal a first three points of the campaign for the side just relegated from the Premier League.
Manager Graeme Jones made two changes to the side that drew with Middlesbrough in the Sky Bet Championship season opener last Friday.
Coming into midfield for his full debut after a substitute's appearance in the 3-3 thriller at Kenilworth Road was Jacob Butterfield, while George Moncur also started after impressing from the bench against Boro.
Andrew Shinnie and Elliot Lee are the two men who drop to the bench as a result, where they are joined by one of the three deadline day loan signings, James Bree, with Lloyd Jones the man to miss out.
So the Town started with a back four of Martin Cranie, Pearson, captain Sonny Bradley and Dan Potts in front of goalkeeper Simon Sluga, with Butterfield anchoring a midfield also containing Pelly-Ruddock Mpanzu and Ryan Tunnicliffe, with Moncur, Callum McManaman and James Collins as the front three.
The hosts made a flying start, wideman Josh Murphy wasting three good openings in the first three minutes as the Town rode their luck in front of a buoyant home crowd.
The Hatters found their feet gradually, however, and after some terrific passing right from the back, McManaman had the first attempt on goal after Butterfield's eight-minute free-kick was headed clear, but the summer signing from Wigan couldn't keep his volley down from the edge of the box.
Sluga was at his best to prevent the Bluebirds taking the lead on 16 minutes when he tipped Sean Morrison's header onto the crossbar, then Murphy fizzed a low ball across the six-yard box that Gavin Whyte failed to convert with the goal at his mercy.
Murphy was soon the first name into referee Darren Bond's notepad as he went down too easily under challenge from Mpanzu.
Town were playing some lovely football when in possession, and another patient move from the back led to the first real sight of goal, with Moncur putting Potts clear on the left.
The full-back made ground towards the City box and his low cross was right into Mpanzu's path, but it was McManaman who got the final effort in, hooking the ball towards goal off the midfielder's touch, only for Alex Smithies to make a good save with his body.
The Hatters' openings were all falling McManaman's way, and the next came a minute before half-time when Moncur whipped an inviting cross in from the left touchline, but the forward couldn't keep his header down as he stole a march on his marker Joe Bennett.
Moncur had the first shot on goal of the second half, letting fly from 22 yards but the ball flew harmlessly over Smithies' bar again.
But within seconds the Town were behind as Murphy curled a free-kick into the six-yard box from deep on the Cardiff left, and centre-half Aden Flint stabbed it past Sluga at the far post.
Jones responded by putting Harry Cornick on in place of Moncur, but the hosts were in the ascendancy and from another high ball into the six-yard box, Collins had to deflect a goal-bound shot from Murphy for a corner, with Sluga out of his goal.
Cornick's pace threatened to bring the Town level just after the hour when he intercepted a ball in front of Bennett and raced to the byline, picking out McManaman with his cut-back, but the former West Brom man couldn't get his shot off and Cardiff smuggled the ball clear.
Collins then pulled a dangerous-looking cross back, which Mpanzu retrieved and sent a curling effort wide, before Cornick drove to the same byline once more and found last season's top scorer lurking on the edge of the six-yard box, but Collins' snap-shot found the side-netting.
There was a let-off for the Town in the 69th minute when Junior Hoilett, just on as a sub for Murphy, delivered a semingly inch-perfect cross for Robert Glatzel, but the German striker didn't connect with his header in front of goal.
James Bree was introduced for his debut in place of Cranie, then Luke Berry came on for Butterfield with just under ten minutes of normal time remaining as Jones searched for a way back into the game.
And it was Berry who helped provide the breakthrough the Hatters deserved when his right-wing corner found Pearson's head with four minute left, and the centre-half found the bottom corner with a thumping effort, sending the 2,000 travelling Town fans at that end of the ground into delirium.
Town still had some defending to do, Potts heading a Joe Ralls cross clear under pressure inside his own six-yard box, before Berry threw himself in the way of a follow-up shot from the edge of the area.
There was last-gasp heartache though, and it came in familiar form with ex-Hatter Isaac Vassell coming on as an injury-time sub and nodding in from close range for the 96th-minute winner.
TOWN: Sluga, Cranie (Bree 74), Pearson, Bradley (c), Potts, Butterfield (Berry 84), Tunnicliffe, Mpanzu, Moncur (Cornick 55), McManaman, Collins. Subs: Lee, Shinnie, Galloway, Shea.
Goal: Pearson 86
Yellows: Collins, Potts
CARDIFF: Smithies, Peltier, Bennett, Morrison (c), Flint, Ralls, Glatzel (Vassell 90+1), Murphy (Hoilett 68), Paterson, Pack, Whyte (Vaulks 76). Subs: Day (GK), Bacuna, Nelson, Bogle.
Goal: Flint 52, Vassell 90+6
Yellows: Murphy, Paterson
REFEREE: Darren Bond
ATT: 24,724 (2,064 Hatters)