O'Gara, who is hoping to make it a hat-trick of consecutive Lions tours later this summer, slotted four penalties and a drop goal and also added the extras to Jamie Heaslip's second-half try.
Chris Paterson contributed all Scotland's match points through five penalties but Frank Hadden's men were unable to build on their recent win over Italy at the same venue.
Ireland now face tournament holders Wales in Cardiff next Saturday knowing another win would give them just their second Grand Slam in their history, while a narrow loss should also guarantee the Championship title.
A Welsh side that featured nine changes from the defeat in Paris a fortnight ago kept their title-winning hopes alive earlier in the afternoon, although Warren Gatland's side struggled to overcome Italy in a scrappy affair in Rome.
A late try from Tom Shanklin secured a 20-15 win for Wales after the Italians had taken the lead with just nine minutes left to play.
Wales now know that a win by 13 points or more over Ireland would see them regain the Six Nations title depending on how France fair against England at Twickenham tomorrow and then Italy next weekend.