The 33-year-old Munsterman rolled back the years as his accurate kicking pinned Scotland back and he topped off his performance with a try of his own, handing off hooker Ross Ford on his way to the try-line.
"I'm far from finished, I really enjoy playing with the boys. There is no better place than Murrayfield to express yourself," said O'Gara, who is now just two points away from breaking the 1,000 international point barrier.
"I think at this level the margins are very fine, losing by one score to France, beating Italy by one score, winning here by one score.
"I think we were very good at times today and very poor at times but in the end it's all about winning, and that's what we did.
"We had fantastic support today and I think that means a lot to the players."