The hosts gave themselves too much to do as they trailed 15-3 at the interval but a storming second-half performance very nearly snatched victory from the jaws of defeat.
Wales scored two tries courtesy of Owen Lane and Rhys Patchell with Jarrod Evans and Patchell contributing seven points from the kicking tee.
Gatland names his 31-man squad to travel to the World Cup in Japan tomorrow and he insists it was a worthwhile exercise against Ireland.
“I think it was a good exercise and some people put up their hands up and gave a good showing,” said Gatland.
“We had a few questions answered and it was good from that point of view. We realise a lot of players had their first starts today which was tough for them.
“We’re disappointed with the result but I’m happy with a lot of aspects of what we got out of today knowing that we will be better. This group of players never give up and we were victims of our own destiny in terms of us creating a lot of issues ourselves with turnovers.
“We never felt stressed enormously from Ireland’s attacking game but they defended well and their set-piece was excellent. There are a couple of areas where we need to work on to get better for next week.”
Gatland says it will be the strongest squad he has taken to the World Cup in his extremely successful 12-year tenure as Wales head coach.
Gatland was speaking in his final press conference at Principality Stadium – he will be moving on at the conclusion of the World Cup.
“It’s a nation of 3.3 million people and I think we’ve massively overachieved in what we’ve done over this last 12 years but we’re not finished yet,” he said.
“If we are mentally and physically right and go out there and are on our game I think we can beat any team in the world. I honestly believe we will go a long way at the World Cup.
“I think it’s the best squad in terms of the depth that we’ve got. I think we’ve got an excellent loose forward group to pick from with some real leadership and experience.
“We’ve got some nines who are continuing to develop. I just think if we do pick up some injuries like we did in 2015 I think we’ll be able to cope with them so much better now.
“The expectations from ourselves is we will be very disappointed if we don’t make the quarter-finals of the World Cup. That’s the first step and then you take every game as it comes from there.”