For parts of the match Castres were the better team and the home side can count themselves lucky to have come away winning after missing five kicks in the first half.
Place-kicking is routinely highlighted as the primary chink in the Saints armour, and misses by Bruce Reihana and Shane Geraghty almost cost them dearly here.
Castres then took the lead against the run of play after 21 minutes with Joe Tekori driving over from close range for an unconverted try.
With nine minutes to go to the interval Northampton finally got on the scoreboard. A clever blindside pass from Lee Dickson sent Reihana over unopposed in the corner, but the wing missed his fourth kick with a difficult touchline attempt.
Cameron McIntyre restored the French lead with a neat drop goal, but Northampton hit back after the break with a Ben Foden try, converted by Shane Geraghty for 12-8.
Castres full-back Pierre Bernard hit a penalty after 60 minutes but Geraghty – who had earlier completely scuffed a penalty effort – restored his side’s four-point advantage before replacement Stephen Myler also converted with three minutes to go, and the Saints held on.
Glasgow claimed revenge for last month’s Magners League defeat at Rodney Parade as they opened their Heineken Cup campaign in Pool Six with a 21-13 home victory over the Dragons.
Dragons winger Adam Hughes crashed over unopposed early on and Matthew Jones slotted the conversion.
Glasgow number 10 Ruaridh Jackson then kicked three penalties in quick succession as referee Jerome Garces ran out of patience with the Dragons infringing.
A converted Graeme Morrison try put Glasgow 16-7 up, but penalties either side of the break from Jones cut the gap to three points.
But hooker Fergus Thomson went over for Glasgow’s second try to seal victory.