A fantastic free kick from Brandon Miele two minutes from time was enough to decide a dour match against plucky visitors Bray Wanderers.
The Hoops came into the match desperate for a first win in five matches but seemed to carry some of their previous form into the opening exchanges.
It was just past the 20 minute mark when they fashioned their first half chance of the game as Damien Duff almost fed Drennan with a through ball that was cut out by Bray.
The first half was an extremely sterile affair with little of interest happening in either penalty area.
The second half was a tiny bit livelier and while The Hoops had most of the possession they struggled up front to turn this dominance into chances.
There was almost a shock opening goal for Bray with 20 minutes to go when Ryan McEvoy got on the end of low cross to the near post but he couldn’t get enough on the ball and his effort was just off target.
With time running out Brandon Miele was fouled on the edge of the Bray area by Wanderers defender Niall Cooney.
The ex Newcastle United lad has probably been Rovers best player this season and duly dug his team out of a massive hole by smashing the resultant free kick into the back of the visitors net to give Rovers a vital three points in the race for European qualification.
The win moves The Hoops five points clear of St Pats in third place, however they have played a game more than the Inchicore side.
Shamrock Rovers: Murphy; Madden, Kenna, Blanchard, D. O’Connor; G. Brennan, McCabe (R. Brennan , 90), McPhail (Cregg, 72), Miele; Duff (North, 67); Drennan.
Bray Wanderers: Cherrie; Douglas, Cooney, McNally Barker; Cassidy, Kelly, Sullivan, McEvoy, Hanlon (Wixted, 83); Lyons (Scully, 80).
Referee: Paul Tuite.