A great ball out of defence from Richard Taundry with six minutes remaining set Alex Nicholls free and his cross found leading scorer Deeney who sent a diving header past Bees goalkeeper Wojciech Szczesny.
It was a win the Saddlers deserved, although Brentford, who had taken an early lead, fought all the way with Toumani Diagouraga outstanding in midfield.
The Bees went ahead after 17 minutes with a well-taken goal from Charlie MacDonald, who chested down a cross from Mark Phillips before driving the ball into the roof of the net.
Walsall levelled in the 35th minute when clever work by Darren Byfield set up Nicholls who scored with a low right-foot shot.
The home side had midfielder Dwayne Mattis stretchered off in the 52nd minute and goalkeeper Clayton Ince pulled off a good save from a Ben Strevens volley, but Deeney popped up to secure Walsall’s second win in a week.