Derry City suffered their fifth home defeat of the season in the Airtricity League as leaders Sligo Rovers snatched victory at the Brandywell.
Sligo bossed the first half with Ross Gaynor hitting the Derry woodwork.
The visitors did take the lead on 55 minutes when David Cawley's swerving shot flew past Gerard Doherty.
David McDaid's deft finish after a superb Conor Murphy ball levelled the contest on 65 but Mark Quigley struck Sligo's winner four minutes from time.
Derry were without injured Stewart Greacen, Kevin Deery, Mark Farren and Rory Patterson plus suspended Stephen McLaughlin and Stewart Madden but Barry Molloy and Patrick McEleney did pass late fitness tests.
Sligo, seeking their first top-flight championship success since 1977, made a bright start with Quigley glancing wide a Gaynor cross in the third minute.
Rovers then had a penalty shout when Raffaele Cretaro appeared to be bundled over in the box but referee Damien Hancock waved aside the visitors' claims.
As Sligo bossed the contest, Ryan McBride needed to head away a dangerous cross from lively Romauld Boco while Gaynor then hit the woodwork with a low angled shot.
Derry had a penalty claim of their own late in the first period as Alan Keane appeared to push Ruaidhri Higgins in the box.
Keeper Gary Rogers came to Sligo's rescue after the restart after a dreadful Danny Ventre backpass nearly put debutant Murphy in for Derry.
However, Sligo did take the lead on 55 minutes as Cawley's swerving shot from 25 yards flew past Gerard Doherty.
Boco was inches away from adding to Sligo's lead on 59 minutes but Derry got on terms six minutes later as Murphy's superb defence-splitting pass was delightfully dinked over Rogers by McDaid.
Lively substitute Pascal Millien was involved in the winning goal in the 86th minute with Seamus Conneely's pull-back being played on Boco into the path of Quigley who slammed past Doherty from 10 yards.
The victory extends Sligo's lead over St Patrick's Athletic at the top of the table to seven points.