The striker, out for almost two years with a cruciate injury, opened the scoring - seven minutes after coming on - when he fired home from close range after a goalmouth melee in the 83rd minute.
The 24-year-old, who scored in stoppage time on Saturday to earn the Bees a point against Bristol City, struck again three minutes later with a clinical angled drive after Lasse Vibe had broken clear from the halfway line.
Kenneth Zohore gave the visitors hope at the death when he capitalised on a mix-up between centre-back Harlee Dean and Yoann Barbet to slide home, but it was too little, too late.
It was a game of two halves at Griffin Park, as City dominated the opening exchanges and should have gone in ahead at the break.
Anthony Pilkington squandered a hat-trick of efforts as the Bluebirds pressed for an opening in a first half where they created the better chances.
His low point came with the game just 11 minutes old when he steered a header from Peter Whittingham's corner wide when completely unmarked.
Five minutes later he cut inside a ponderous Brentford defence only to fire an angled drive well wide of the far post.
He came closer to finding his range on 19 minutes when he ran at the home defence only to drill a low effort inches past the upright.
The striker thought he had earned a penalty when he crashed to the turf in the box under a strong Dean challenge, but referee Stuart Attwell waved away Cardiff protests.
Brentford created few clear-cut chances. Their best opportunity came on the half-hour when Konstantin Kerschbaumer found Ryan Woods on the edge of the box, but the former Shrewsbury man fired high and wide.
Whittingham lashed just over the bar from the edge of the box as the Bees defence failed to close him down, and Craig Noone also saw an angled drive fizz wide as City ended the half in the ascendancy.
After the break, though, it was a different story as Brentford broke intelligently, Alan McCormack the first to test goalkeeper David Marshall with a stinging low drive.
Dean Smith's side should have broken the deadlock on 57 minutes when they broke three on one only for Lasse Vibe to fire straight at Marshall with the goal at his mercy.
Minutes later Dean headed skipper Jake Bidwell's well-worked free-kick agonisingly wide after Craig Noone was yellow-carded for a lunge on McCormack.
Pilkington's whipped effort reminded Bees goalkeeper David Button of the Welsh outfit's threat, but they only really looked dangerous once Brentford had taken the lead.
Bidwell's corner was glanced on to Barbet, whose snapshot bounced back off the bar - but only as far as Hogan, who slammed it home with interest from five yards.
His second was the pick of the game as he waited and waited for Vibe's through-ball to coolly slot home from the tightest of angles.
Zohore's late consolation gave the visitors brief hope, but there was to be no grandstand finale.
Cardiff now have their work cut out to make the play-offs, sitting six points behind sixth-placed Sheffield Wednesday. Brentford remain 13th.