Northampton coach The home side only led 12-0 after 60 minutes through four Stephen Myler penalties, but then blew the French side away with five tries in the final quarter to avenge last week's defeat in the reverse fixture.
Mallinder said: "I'm pleased with our performance. I was disappointed last week, we attacked well but our discipline and defence was poor.
"At half-time I told them not to get frustrated and we needed to be a little more accurate."
Mallinder introduced key players Lee Dickson and Sione Tonga'uiha on the hour and they made important contributions in breaking down the Castres rearguard.
Mallinder added: "The subs made a considerable impact today and all credit to them as we needed to keep their pack moving around."
Northampton have no hope of progressing further in the Heineken Cup, but still face games against Munster and Scarlets in January.
"That win gives us a chance to make it into the Amlin Challenge Cup but we will need a couple of good wins against those tough sides to have a chance of getting there," Mallinder added.
"We are focusing on our next three league games against Bath (home), Newcastle (away) and Quins (home), and are aiming for three victories."
Castres chose to rest a number of last week's victorious side and paid a heavy penalty.
Castres coach Laurent Travers said: "Northampton had points to prove. They conceded 40 points at ours last week and are not Heineken Cup finalists for nothing.
"We defended well for an hour but, once their first try went in we had no answers and it was just too difficult."
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.