Villa had not won since their success over Manchester City in September, but they got back to winning ways in what was a largely forgettable contest in the west Midlands.
The opening goal came with just 14 minutes left and it was the one moment of real class during the match.
As Bacuna lined up his free-kick, Villa had at that point gone seven-and-half hours without a goal in the Premier League but he made no mistake as he curled the ball past the wall into the corner as David Marshall could only watch on.
To that point neither keeper had been very busy, although Marshall had produced one excellent save from Kozak before the Czech did manage to beat the Scotland international late on to seal the points for the home side.
With six minutes left, as Cardiff failed to clear their lines, Matt Lowton headed the ball back into the six-yard box and Kozak rose to head home.
Prior to that late action it had been an unedifying affair all round, with Villa booed off by their own fans at the interval.
The hosts began with plenty of attacking intent, Kozak’s header drawing a good save from Marshall after just a minute – though an offside flag would have cancelled it out regardless.
Marshall was less assured when Karim El Ahmadi tested him from 25 yards, palming the ball back into the danger in front of goal with Christian Benteke sniffing around.
Luckily for the visitors Steven Caulker was a fraction quicker off the mark than the Belgian and cleared the danger.
Caulker was also the unlikely originator of Cardiff’s first real attack, carrying the ball towards the edge of the Villa area before chipping a pass towards Aron Gunnarsson.
Villa might have conceded had Peter Odemwingie got a clean connection with his attempted volley but, when it bobbled away from the Nigerian, Ron Vlaar slid in to avert the danger.
Gary Medel’s floated free-kick then drew Kozak into a defensive header that wrong-footed Brad Guzan and flashed across the face of his own goal.
Benteke, still looking for the inspiration that was ever-present last season, had one further sight of goal but shot wide having ignored Aleksandar Tonev’s intelligent run.
When the sides went in for the break there was an audible, though hardly deafening, chorus of boos from the home support.
Nathan Baker’s body check on Odemwingie 25 yards out gave Cardiff the first chance to spark the game into life after the break and former Villa man Peter Whittingham stood over the free-kick.
He whipped the ball across the area but none of his team-mates were able to get a boot to it.
Villa countered and went closer than ever to an opening goal as Bacuna’s cross found Kozak at the far post and Marshall produced a fine save to tip it wide.
Malky Mackay had seen enough of Odemwingie after just 55 minutes and sent on Fraizer Campbell, whose high-energy style at least provided a sharp contrast to the man he had replaced.
Benteke then had two headers in the space of 10 minutes from positions he would typically fancy but on each occasion his radar was off and he failed to hit the target.
Bacuna, moved into midfield as part of a tactical reshuffle which saw Lowton come on, rescued the game from stalemate.
He powered into the Cardiff half and was heading towards the penalty box when Medel cynically pulled him back.
But that merely delayed the danger as Bacuna curled the resulting free-kick round the wall, leaving Marshall flat-footed as the ball hit the net.
Villa made the points safe when Kozak claimed his second goal for the club, heading home after a period of untidy defending by the Bluebirds.
Tonev’s initial cross was not cleared, allowing Lowton to head back towards Kozak, who applied the finishing touch from six yards.