The Scottish Premier League leaders, reduced to 10 men after Colin Hendry was sent off, looked unable to breach St Johnstone until Porrini's thunderous 71st-minute shot.
Equally, they were indebted to their new goalkeeper, Stefan Klos, who touched Paul Kane's late shot onto the bar to protect the points.
But such is football's capricious nature, Porrini was not the only one refusing to conform to type at Ibrox. St Johnstone had conceded 11 goals in the previous two League encounters with Rangers and had not won here for 27 years.
Yet, there they were in the second half leaving Dick Advocaat's depleted side looking as if they had escaped from the Alamo. Three times Saints struck the bar and they even missed a penalty.
The sinner on that occasion was John O'Neil, but the visiting manager, Sandy Clark, admitted: "John is one of my better footballers, so I am not going to blame him. But we will never have a better chance of winning here than we did today."
Any such hopes were removed by Porrini with just 19 minutes to go. The Italian right-back fed the substitute, Neil McCann, who had replaced the limping Andrei Kanchelskis, on the right flank.
McCann, making his home debut after his pounds 1.9 million move from Hearts, tormented Alan Kernaghan before slipping a pass back to Porrini, who met it cleanly to lash a right-foot shot high into the roof of the net.
The Rangers manager Advocaat later said: "After Hendry went off, we were under pressure. Still, at least Hendry made an excellent save before going."
Time can be a wonderful healer, because it must be doubtful if Advocaat was feeling so jocular in the 48th minute when Hendry was shown the red card. The former Blackburn defender was made to look foolish by Paddy Connolly after the Saints striker left him and Klos for dead only to be denied a certain goal by Hendry's illegal hand.
O'Neil, however, could not punish Rangers further, striking his penalty against the junction of post and bar. Four minutes later, Nick Dasovic thundered a header off the bar too and then Kane hit the same unsweet spot in the 90th minute with a perfect shot from 20 yards.
Klos, signed on Christmas Eve from Borussia Dortmund, produced a vital fingertip to direct it onto the woodwork and even the taciturn Advocaat reflected: "You could see Klos's experience. Whatever he did, he did well."
That was a wonder considering the German had shivered throughout the first half as meek St Johnstone failed to dirty his gloves, with his counterpart Alan Main producing the real highlight by turning Giovanni van Bronckhorst's 24th-minute shot around the post.Reuse content