Castagne celebrated his return to the team after a thigh operation with a 20th-minute goal when the full back unleashed a venomous shot from outside the box that arrowed into the top corner and gave goalkeeper David Raya no chance.
Raya had been rewarded with a maiden call-up to the Spain national team this week after fine performances in goal, but he could do nothing about the second when Maddison curled a free kick over the wall and into the net.
"We played Leicester two times and three of their goals were top corner worldies," Brentford manager Thomas Frank told the BBC, adding that he felt his side were the better team in the second half.
"I knew Maddison could do it and [Youri] Tielemans earlier this season. Maybe not Castagne, but fair play to him."
Raya's opposite number Kasper Schmeichel denied Brentford twice with quick reflex saves early in the second half, palming away a bullet header from Pontus Jansson before stopping a Bryan Mbeumo header from point-blank range.
Brentford were dealt a blow before the game when midfielder Christian Eriksen, who had made a significant impact since he joining in January, was ruled out with COVID-19.
But Yoane Wissa gave Leicester reason to sweat towards the end when he halved the lead in the 85th minute, firing a shot past Schmeichel for the third long-range goal of the game.
Brendan Rodgers' Leicester held on for three points while Brentford remained 15th, eight points above the relegation zone but having played more games than the bottom four teams.
"We need to be more precise, that's why I won't get too carried away as there's so much more to improve on," Rodgers said.
"But I can never accuse them of a lack of effort and determination. Brentford put the ball into the box, we stood up to that."