© PA Photos
James Haskell was sent to the sin bin on 56 minutes for kicking the ball away from the base of an Irish ruck.
O'Gara converted the resultant penalty to level the scores, but 14-man England defied their numerical disadvantage, as Farrell kicked two more penalties to restore the visitors' six-point lead.
Shortly after Haskell's return to the field, O'Gara directed a 30-metre penalty narrowly wide of the posts.
Farrell then followed suit at the other end, setting up a nervous finish with Ireland requiring just a converted try for victory.
However, England kept their discipline and held on to claim their first win in Dublin for 12 years.