Julian Gray volleyed home the winner from Darren Byfield’s cross in the 54th minute after Brentford had failed to clear their lines.
The visitors had taken the lead after 12 minutes when Alex Nicholls latched on to a harmless looking through ball to fire past stranded Bees goalkeeper Alex McCarthy.
After that it was all Brentford and they drew level just before the break, with Gary Alexander flashing a header past Sadlers’ goalkeeper Jonny Brain from Robbie Simpson’s right-wing cross.
Brentford peppered the visitors’ goal with shots, Sam Wood and Alexander both firing narrowly wide before Gray smashed home at the far post.
Alexander went close to levelling in the 66th minute with a clever lob, which was
well saved by Brain, who also kept his side in it with a reflex save with his leg from Craig Woodman’s 90th-minute free-kick.