A goal-of-the-season contender from Kevin Devaney gave resilient Bohemians the spoils despite St Patrick's Athletic's dominance in this SSE Airtricity League Premier Division Dublin derby at Dalymount Park.
It marked a big first win in six games for Keith Long's Gypsies to keep them three points above Limerick in the relegation play-off place.
Free-falling St Patrick's are left looking over their shoulder as they've now lost six on the spin.
In humid conditions and bright sunshine on a bone-dry pitch, St Patrick's passed it well from the off, carving the first opening of the game 16 minutes in.
Thomas Byrne, just booked for a foul on Dan Casey, stole in behind the home defence onto Jamie Lennon's ball over the top.
He laid it off for Ryan Brennan whose shot lacked power as Shane Supple made a comfortable save.
Brennan was then guilty of missing a clear-cut chance a minute later. Played clean through one-on-one by Conan Byrne, the midfielder drew Supple only to see his shot trickle wide.
Supple saw action again three minutes after that with the first telling save of the night, flying to his left to push Lennon's shot round a post following a Killian Brennan corner.
Conan Byrne then worked Supple once more on 23 minutes with a stinging drive after dominant St Pat's again got in behind the sluggish home defence.
And there was another let-off for Bohs on the half hour. Again it stemmed from Conan Byrne raiding down the right to cross, forcing Rob Cornwall into a goal-saving block tackle on Thomas Byrne before the ball was scrambled clear.
Remarkably, having scarcely been in the match, Bohemians, who were about to make a substitution, then took the lead with a bolt from the blue on 39 minutes.
Winger Devaney cut in off the left flank and hit a thumping right foot drive from some 35 yards that arrowed into the top-right corner of Barry Murphy's net.
Inspired by that, Bohemians were better from the restart, Dylan Watts coming alive to force two last-ditched clearances from Lee Desmond and then Ryan Brennan.
Conan Byrne remained Saints' main threat as they chased the game, bringing another save from Supple before crossing for Ryan Brennan to volley off target.
Supple then drew chants of â€˜Super keeper' from the Gypsies' faithful with another save, this time with his feet from Thomas Byrne, to complete St Patrick's night of frustration.