Longford Town faced into this game having learned that four points would be deducted from them as a result of Dublin City's departure from the Eircom League.
However, they will gain plenty of solace from this encouraging performance against St. Pat's in the Premier Division.
St. Pats lost three points due to the Vikings surrender and for long periods in the first half they looked like getting them back.
They had been the dominant side but fell behind in the 35th minute to a stunning Alan Kirby finish. Johnny Martin set up his fellow midfielder who picked his spot and curled the ball around the advancing Barry Ryan.
Darragh Maguire had a chance to put the visitors ahead earlier in the half but his header was saved by Mick Dempsey. Former Town player, Paul Keegan also had a couple of half chances for the Dubliners before the break.
Longford should have doubled their advantage in the 51st minute. Davy Byrne's excellent pass left Robbie Martin in the clear but the striker shot straight at Ryan when it seemed easier to score.
The home side did grab a second in the 64th minute. Johnny Martin whipped in a cross for younger brother Robbie, who headed home his first goal since joining the midland club at the start of the season.