Castres withstood more Edinburgh attacks and scored their second try of the match on the breakaway.
After the restart, Edinburgh continued to dominate possession and eventually broke Castres' resistance to regain the led.
Dempsey's early try came after a defensive error in the Castres backline and Sexton kicked the extras.
Filipo Levi of Newcastle and Iosefa Tekori, who plays for French club Castres, provide the power at lock.
Castres full-back Pierre Bernard sent a penalty wide from long range before Reihana missed off the tee once more.
Sebastien Tillous-Borde touched down a consolation for Castres as Northampton, already through as group winners, guaranteed last-eight home advantage.
With the score at 21-6, it certainly looked a tough task for Castres.
Legardere then brought Castres, down to 14 men with Steve Kefu yellow-carded, back to 15-15 with two well-struck penalties.
Saints soaked up some intense Castres pressure before Ben Foden finished off a superb Ansbro break to make it 20-7.
Joe Ansbro and Phil Dowson crossed, with a Pierre Bernard try keeping Castres in touch at 15-7 at the break.
But a superb passing move by Castres ended with Terrain touching down in the corner, Romain Teulet adding the conversion.
Australian centre Kefu, 29, arrives from Castres Olympique, number eight Ward-Smith, 31, from Bristol and 23-year-old wing Varndell from Leicester.
Pau became the fourth French side in as many years to win the European Shield, at the expense of Castres.
Jonathan Thomas, the Ospreys flanker sent off for punching in the match at Castres, has been banned for 18 days.
BBC: SPORT | Rugby Union | European Club | Lengthy bans for Heineken Cup duo
But Anthony Legardere then added three penalties to his three in the first half to secure a first win for Castres.
Ibanez began his career in his hometown of Dax before moving on to Perpignan, Castres and then to Saracens in 2003.
But a host of missed chances before a second try for Thomas Bouquie handed Castres only their second win of the campaign.
Wasps' defeat by Castres meant Leinster topped the table by three points.
But with Wasps losing against Castres, Leinster had done enough although there is plenty of work to do ahead of the knockout stages.
Jones spent most of the 2004-05 season playing at tight-head, facing the renowned scrumming powers of Munster and Castres in the Heineken Cup.
Leinster, six points clear in the group, now face Castres away on Friday before the expected crucial showdown away to Wasps on 17 January.
Caerphilly also played in a European final when they were hammered 40-12 by French side Castres in 2003, in the third-tier European Shield competition.
Even when John Mallett was sin-binned for the second time in two weeks, this time for punching, Castres failed to make their numerical superiority count.
Castres had rested key players including Romain Teulet and France winger Marc Andreu ahead of an important Top 14 clash against Stade Francais on Thursday.
Full of confidence and oozing in class, Castres ran the ball from their own line and saw Nicolas Spanghero cross for his side's fourth try.
And it will banish the painful memories of their last visit to France, which saw them limp to an 18-15 loss to Castres last December.
Castres looked for a reply before the interval, but could only reduce the deficit through two penalties from the boot of France international Thomas Castaignede.
In the 27th minute, Castres smartly switched the play from left to right before some quick recycled ball in the corner allowed Bernard to power over.
But Castres then displayed midfield frailty to allow Sexton to round off a slick move after Luke Fitzgerald's half-break for a second try for the visitors.
In the front row, hooker Leonardo Ghiraldini and prop Andrea Lo Cicero replace Carlo Festuccia and Salvatore Perugini while Castres wing Pablo Canavosio takes Masi's place out wide.
应用推荐