The visitors triumphed 23-21, courtesy of Leigh Halfpenny’s 80th-minute penalty, which was awarded by English referee Wayne Barnes when Irish flanker Stephen Ferris tip-tackled Ian Evans.
Ferris received a yellow card, as did Wales lock Bradley Davies earlier in the game, although Davies’ tackle on Donacha Ryan was far more serious and looks certain to see him cited and banned.
Wales outscored Ireland 3-2 on tries, and then Halfpenny came up trumps under colossal pressure to send his team on the march towards a possible Six Nations title and Grand Slam.
Gatland said: “We were reasonably lucky. I thought we were only at about 70 per cent today.
“But to come here and be under pressure and to come back with 14 men shows great character.
“The displeasing thing was a bit of a lack of discipline with the yellow card. We got out of jail, but we’ve won our first game of the tournament away from home.”
Gatland felt Davies was lucky to only get a yellow card, and admitted he fears the worst in terms of a citing.
Wales are already without the services of injured locks Luke Charteris and Alun-Wyn Jones, so any period of suspension for Davies could hit second-row resources hard.
“We’ve got to plan, potentially, for him being cited,” Gatland added.
“I’ve seen a replay, and I won’t deny it wasn’t fantastic. Potentially, we have got to prepare for the worst.”
He hailed a “world-class” performance by wing George North, who scored one of Wales’ three tries, while he had sympathy for fly-half Rhys Priestland, who missed two easy penalty kicks.
“We shouldn’t have put so much pressure on Rhys with the kicks. He has been out [injured] for a few weeks. It is such a confidence role, but I thought he was excellent in the second half.”
Halfpenny took over kicking duties from Priestland, and he admitted his last-gasp strike as “the hardest kick I’ve had to take in all my life”.
He said: “As soon as it went over the emotion came. Having to deal with the miss against France in the World Cup semi-final, putting that over makes it all worthwhile.”