Lorient moved into the top four in Ligue 1 after returning to winning ways but they were given a scare by struggling Troyes.
Christian Gourcuff's men have been one of the surprise packages this term and looked firmly on course for victory thanks to first-half goals from Kevin Monnet-Paquet and Enzo Reale.
They were pegged back by Jeremie Brechet after the hour mark and although Gregory Bourillon restored the hosts' two-goal lead, Fabien Camus set up a tense finale with two minutes left.
The resilient visitors could not find a leveller, however, and they remain second from bottom - seven points adrift of safety - while Lorient continue to defy the odds and are still firmly in the hunt for a Europa League spot next season.
They nearly fell behind early on as Stephane Darbion burst clear of Lorient's defence but with just Fabien Audard to beat, he could only direct his shot straight at the Lorient goalkeeper.
At the other end Yann Jouffre picked out Monnet-Paquet in the area and he controlled before volleying at goal, with Yohann Thuram-Ulien producing a fine save.
However, the Troyes keeper was beaten when the hosts launched their next assault at his goal. The dangerous Monnet-Paquet collected the ball from Jeremie Aliadiere before volleying home from just outside the area in the 20th minute.
Thuram-Ulien's reaction save from Aliadiere's close range header stopped Lorient temporarily before Reale did net in the 26th minute. Maxime Barthelme's long ball over the top allowed fellow midfielder Reale to superbly volley straight into the top corner.
Troyes refused to surrender, however, with Darbion's hopeful strike from distance after half-time forcing a decent save from Audard.
And the visitors were rewarded for their endeavour in the 66th minute when Brechet rose the highest from Darbion's corner to powerfully head past Lorient's keeper.
The goal failed to sufficiently rouse Troyes' charge, however, and it was Lorient who restored their two-goal cushion in the 84th minute after Bourillon headed home from Reale's free-kick on the left.
Once again, Jean-Marc Furlan's men did not accept defeat and Brechet continued to cause havoc at set-pieces, but this time his header from Granddi Ngoyi's corner cannoned off the bar.
But they did give themselves a chance with two minutes remaining when Camus netted following Julien Faussurier's ball into the box, but it proved too little, too late.