Peter Enckelman saved Kris Commons' penalty after three minutes and the Saints keeper went on to enjoy a fine afternoon with a string of impressive saves.
Mackay's deflected shot on the hour mark sealed a miserable day for the Parkhead side who hit the woodwork through Commons and substitute Paddy McCourt.
Celtic had the chance to take the lead in the third minute when they were awarded a penalty by referee Brian Winter after he adjudged Enckelman to have up-ended Anthony Stokes in the box. The Saints goalkeeper made up for his transgression, however, by diving to his right to save Commons' spot-kick.
Celtic shrugged off the missed opportunity to pin St Johnstone back and Stokes drilled an angled-shot past the far post after working some space for himself inside the Saints' box.
When Saints midfielder Murray Davidson fouled Ki Sung-yueng 25 yards out, Commons struck the post with his flighted free-kick.
Celtic were getting closer and had another chance a minute from the break when Stokes was slipped in by Joe Ledley but Enckelman dived at his feet to make a crucial save and keep the visitors on level terms going in to the second half.
Hoops keeper Fraser Forster made a decent block from Jody Morris' drive but on the hour mark the visitors took a sensational lead. When Liam Craig's ball from the left arrived at Mackay at the far side of the box, the Saints defender drilled the ball towards goal and it appeared to take a nick off Murray Davidson before speeding past Forster.
McCourt came on for Commons to provide some much-needed inspiration but the anxiety which had gripped Celtic Park and the home defence looked like helping Saints grab their second.
The Parkhead men stepped up the pressure though, and McCourt side-footed a shot against the post after weaving his way in to the St Johnstone box before Enckelman made another good save from a Stokes header.