Having lost 3-2 in their opening game to St Pats at Tolka Park, Shelbourne gained a measure of revenge as a goal from sub Daniel Kelly gave the Reds a much-needed win.
Both sides hit the crossbar and St Pats defender Sean Hoare saw red for a second yellow deep in added-time at the end of the 90, in a wild finish to the tie as Shels survived a succession of late, late corners to move themselves into the top half of the table.
It was only Shels' fifth win of the season but it was a priceless one, with bragging rights going to the vocal away supporters after victory in this Dublin derby.
St Pats made one change from the win over Waterford, bringing back Jamie Lennon for Darragh Nugent, while Shels saw Jack Henry-Francis replaced by Scot Ali Coote from their draw with Sligo Rover, as Cambridge United loanee Zeno Ibsen Rossi came in for defender Paddy Barrett, whose mother Ann passed away this week
Milan Mbang also started in place on Evan Caffery on the wing for the visitors in one of three changes made by manager Joey O'Brien.
It was the home side that applied much of the early pressure and could well have taken the lead in the very first minute as Chris Forrester cleverly backheeled into the path of James Brown.
Having fashioned the chance, Brown blazed his shot over the bar from close in.
Shels' first attack came in the 10th minute, and Joe Anang did well to get down to Harry Wood's deflected shot which was creeping in at his near post but for the Pats keeper's one-handed intervention.
In the 27th minute Zak Elbouzedi fashioned a chance for Ryan Edmundson as the Saints winger's low fizzing cross was just missed by the sliding striker with the goal at his mercy.
The game did not lack for intensity and indeed Shels lost their captain Kerr McInroy at half-time, booked and injuring his foot because of a crunching tackle on Luke Turner, replaced by Evan Caffery.
And moments after the resumption, Shels missed a glorious chance to break the deadlock as a John Martin shot was headed into the path of Mbeng by the diving Sean Hoare, who cracked in a shot that cannoned away to safety off the underside of the St Pats crossbar
Shels have found away days more to their liking this season with no wins at Tolka Park and they carved out another chance as the effervescent Wood played a neat one-two with William Javis, only for Woods' shot to narrowly miss the post.
Jarvis was deemed to have handled just outside the area after the hour mark, but Forrester couldn't put his side ahead, his free kick smothered by Shels' keeper Wessel Speel, while at the other end Anang was at full stretch to deny Martin's on target header at the midway point of the second half.
But Shels, who had looked dangerous on the break all evening, hit the front in the 82nd minute as substitute Kelly shrugged off the challenge of Kian Leavy after a through ball from fellow sub Rodrigo Freitas and scored beyond the despairing dive of Anang.
In added time St Pats almost snatched a point as Hoare's low shot from the edge of the area looked destined for the net, only for Speel to intervene with a one-handed save and in the most dramatic of finishes, Hoare was then sent off for a second yellow, a prelude to Pats hitting the bar with a Luke Turner header, as Stephen Kenny's side fell to their second home defeat of the season.
© rte.ie