A 2-1 win for Burnley extended Brentford’s Premier League winless run to six games.
The Clarets took the lead through a 10th-minute Jacob Bruun Larsen penalty given after a foul on Vitinho by Sergio Reguilon, who received a straight red card.
David Datro Fofana, having been guilty of a remarkable miss late in the first half, then doubled the advantage with a finish just past the hour mark.
Kristoffer Ajer pulled a goal back for Brentford with eight minutes of normal time to go but Burnley were able to see out what was their first victory of 2024, and only their fourth in the league this season.
Boss Kompany had emphasised pre-match that he had not given up hope of avoiding relegation and after ending their winless run, the gap between second-bottom Burnley and safety stands at eight points with nine games left to play.
Fifteenth-placed Brentford, meanwhile, are four points above the drop zone as their own sequence without victory extended to a sixth match.
Kompany made one change from last weekend's 2-2 draw at West Ham, opting to drop goalkeeper James Trafford - previously an ever-present in the league this season - and bring Arijanet Muric into the team for his Premier League debut.
One of those coming into Brentford's starting line-up as boss Thomas Frank made two adjustments from the 2-1 loss at Arsenal was the fit-again Reguilon, whose return proved extremely short-lived.
An early Burnley attack saw Josh Cullen swing the ball into the box, where Vitinho went to ground following contact from behind from the on-loan Tottenham defender.
VAR intervened and after referee Darren Bond had watched the incident back pitchside, a penalty was awarded, Reguilon was given his marching orders and Bruun Larsen coolly sent the spot-kick past Mark Flekken.
Ivan Toney headed over as Brentford looked to hit back, and Burnley then breathed a sigh of relief when Dara O'Shea misjudged an attempted pass back to Muric and the goalkeeper slid to clear the ball off the line with his boot, then saved Toney's follow-up effort.
At the other end Fofana somehow missed when looking certain to score from close range having been teed up by Lorenz Assignon's cutback.
Muric then produced a fine save to deny Yoane Wissa, before Fofana, having lurked behind Flekken as he prepared to take a kick, emerged to nick the ball, only to be thwarted by the Dutchman as he tried to take it past him.
After Charlie Taylor put a shot over the Brentford bar early in the second half, Fofana was then able to redeem himself in the 62nd minute as he was played in by Wilson Odobert and slotted past Flekken.
Burnley's push for more included Zeki Amdouni's shot being held by Flekken, before their lead was halved by Ajer heading in a cross from Shandon Baptiste.
The Clarets had been 2-0 up against West Ham only to be held 2-2 and fans may have been fearing a repeat as Muric kept out a Keane Lewis-Potter header.
A lengthy period of stoppage time - in which replacement Amdouni was substituted himself - then saw the ball in the Burnley net but no goal given with Toney being penalised for a challenge on Muric, before the final whistle confirmed three points for the hosts.