The Celtic captain struck into the top corner from 25 yards to earn a win that looked unlikely for the majority of the game in Paisley.
The champions failed to register an effort on target until stoppage-time and McGregor’s winner came beyond the four minutes of added time that the match officials had signalled.
The hosts had earlier come closest to a breakthrough through Conor McMenamin, who hit the post after missing from close range.
They also had the ball in the net when Liam Scales sent it past team-mate Kasper Schmeichel but the goal was disallowed for offside against McMenamin.
Celtic looked set to drop points for a fifth time in 12 Premiership games but they put pressure on Hearts before the leaders’ trip to Aberdeen on Sunday.
The build-up to the game had been overshadowed by

Independent.ie Sports

talkSPORT Football
talkSPORT
The Guardian Football
Metro Sport
Mirror Sports
The Daily Record
The National Sports
The List