Castres (6) 6
Pens: McIntyre 2
Edinburgh (7) 13
Try: Robertson Cons: Paterson Pens: Paterson 2
Edinburgh produced a gritty display to record a landmark victory in France
Edinburgh secured their first Heineken Cup success on French soil to boost their hopes of making the group stages.
Phil Godman, making his 100th appearance, missed an early penalty and the hosts rattled up six points via Cammy McIntyre's boot.
Mark Robertson's 15th-minute try saw Edinburgh hit back after he collected Mike Blair's superb pass.
Chris Paterson converted and then added two second-half penalties as the Scots eased to victory.
Both teams played fast and open rugby, and the television match official referee was called into action twice in quick succession.
In the first incident, home hooker Romain Terrain had looked certain to score following a crossfield kick by McIntyre - only for Robertson to dislodge the ball from his grasp at the last split second.
Then Paterson was denied a try at the other end when the video referee ruled he had marginally knocked on.
Castres: Bouquie, Mazars, Kefu, Christophers, Carballo, McIntyre, Senio, Hoeft, Terrain, Ducalcon, Koulemine, Nallet, Malonga, Capo, Nell.
Replacements: Legardere for Bouquie (68), Teulet for Kefu (45), Tillous-Borde for Senio (65), Forestier for Hoeft (73), Giorgadze for Terrain (68), Tekori for Koulemine (48), Faure for Nallet (73).
Edinburgh: Paterson, Robertson, Cairns, De Luca, Webster, Godman, M. Blair, Jacobsen, Ford, G. Cross, C. Hamilton, J. Hamilton, Newlands, MacDonald, Hogg.
Replacements: Houston for De Luca (64), D. Blair for Godman (70), Kerr for Jacobsen (68), Kelly for Ford (73), Gissing for C. Hamilton (53).
Not Used: S. Cross, Laidlaw.