Leinster near European Cup quarters with Castres win
Castres' Fijian centre Seremaia Bai (R) is tackled by Leinster's Irish prop Cian Healy during their European Cup match at the Pierre Antoine Stadium in Castres, southern France on January 12, 2014
The Irish province sit atop Pool 1 with 17 points, four points ahead of Northampton, who ran out 29-17 victors over Ospreys in Swansea.
It means Northampton's only chance of qualifying for the knock-out phase is a bonus-point victory at home over Castres on Friday, with Leinster - who have a far superior points differential - losing at Ospreys.
Kiwi fly-half Jimmy Gopperth was the catalyst in driving Leinster to the away win over the French Top 14 champions, with each side scoring three tries apiece.
"We didn't get the greatest start," Gopperth told Sky Sports. "They're a great attacking side.
"But we got some forward ball and looked after it and scored some tries.
"We worked hard for each other, we want to be in the top eight."
It was Castres' first home defeat in 19 games, but they started well, scoring a fantastic opening try through Scotland lock Richie Gray, set up by a mazy run from centre Remi Lamerat.
Lamerat was proving a real handful and after bumping off a couple of tackles fed winger Remi Grosso who passed back inside to full-back Brice Dulin for a second great try for the French side.
But Castres were left kicking themselves after conceding a soft try from a scrum 10 metres from their own line, Gopperth skipping through some weak defence to dot down.
Gopperth claimed a second try shortly after, driving over from close range to leave it 17-12 at half-time.
The Kiwi then drew Leinster to within two points with a penalty amd full-back Rob Kearney then threw Castres a curveball when he nailed a long-range drop-goal to take the Irish province into the lead.
Momentum had truly swung Leinster's way, Gopperth kicking a quick brace of penalties for a 24-17 lead.
Flanker Jordi Murphy was played in for Leinster's third try to seal a vital win, Lamerat scoring a deserved late consolation try for the home side.
In Wales, Northampton ground out an at-times dour win over Ospreys, Stephen Myler kicking four first-half penalties to one from Dan Biggar.
It wasn't until early in the second hald that the Saints came to life, a turnover and quick play-the-ball setting Wales winger George North haring down the left for a try.
Scrum-half Rhys Webb scored a sniping try for the Ospreys to breathe some life into a game desperately short on quality.
But Northampton hit back with a George Pisi touchdown
The home side were not out of it, however, Alun-Wyn Jones driving over from a line-out, Biggar's conversion taking the score to 22-17.
The Saints responded through an opportunistic Glenn Dickson try to round off a desperately disappointing campaign by the Welsh region.
Toulouse host Saracens in the late game, with both sides still able to qualify whatever the result on Sunday, with final Pool 3 games next week against Connacht and Italian whipping boys Zebre.
Defending champions Toulon, heavyweight French rivals Clermont and former winners Munster all secured places in the quarter-finals on Saturday.
The day's results also ensured Pool 5 leaders Ulster and second-placed Leicester advance into the last eight, both are assured of at least finishing as best runners-up.
They meet next week to determine who will win their pool.