Lyon consigned Toulouse to a home defeat last weekend, but Ugo Mola’s side put that behind them to move just five points behind Montpellier.
There was nothing to choose between the two title contenders in the first half at Stade Ernest Wallon, where Nemani Nadolo barged his way over from close range before Yoann Maestri’s converted try made it 7-7 at the break.
Francois Cros went over from the back of a scrum as Montpellier failed to withstand the pressure and a Thomas Ramos penalty gave the home side an eight-point advantage.
Zack Holmes added a third Toulouse try with Paul Willemse in the sin bin and although Montpellier hit back with a late penalty try, they could not avoid a seventh Top 14 loss of the season.
Beleaguered Brive have now lost six in a row after going down 37-28 in a feisty affair at Stade Pierre-Fabre.
There were four tries for both sides, Florian Vialelle, Rory Kockott, Yohan Domenech and Alex Tulou crossing for Castres to boost their play-off bid.
Tell us what you think about the Rugby World Cup and you could win £100