Both teams were capable of winning Group D heading into the crucial Celtic showdown, while either or both could also have missed out on the playoffs entirely, but ultimately it was a crisp second-half strike from James McClean which sent the visiting fans into ecstasy.
Wales, meanwhile, end the campaign third in the group and are once again forced to wait to reach their first World Cup since 1958 having fallen to their first competitive defeat on home soil since September 2013.
Ireland went into the match knowing that only a win would keep their World Cup dreams alive, while the complicated nature of the permutations for Wales meant that victory was the only way to guarantee their own place in the playoffs.
It was the hosts who were quickly on the front foot with Hal Robson-Kanu - the only change from Friday's win in Georgia - getting in front of his man to nod an early corner wide of the near post after less than three minutes.
In the absence of the injured Gareth Bale, Aaron Ramsey was the highest-scoring player in Chris Coleman's squad, and the Arsenal midfielder also came close in the opening 10 minutes when his powerful long-range drive clipped the top of the crossbar via the fingertips of Darren Randolph.
Joe Allen then fired another effort wide from outside the box before Ireland created their first real sight of goal midway through the opening 45 minutes when Jeff Hendrick fluffed his lines from a good position having seen Wales struggle to deal with a long throw-in into the box.
Friday's match-winner Tom Lawrence looked to repeat his heroics from Georgia shortly afterwards with a bobbling long-range drive, but Randolph got his body behind the ball and was equal to it.
Ireland's best moments of the first half stemmed from set pieces, and Shane Duffy came close shortly after the half-hour mark with a low drive across goal that fizzed a couple of yards past the far post.
Wales suffered a blow with less than 10 minutes remaining of the first half when Allen was forced off with suspected concussion following a heavy collision with David Meyler and McClean, but the hosts could have broken the deadlock moments later when a corner went all the way through to Ben Davies, only for the Tottenham Hotspur full-back to fire an unconvincing effort off target.
There was a late save for Wayne Hennessey to make at his near post from Robbie Brady in stoppage time of the first half, but it was Wales who started the second half on top with two good chances in the opening eight minutes.
The first saw half of the Cardiff City Stadium burst into premature cheers as James Chester's near-post header rippled the side-netting before Robson-Kanu drew the first meaningful save from Randolph from a similar position moments later.
Those chances cranked up the volume inside the stadium, but the home fans were soon silenced when some lax defending allowed Hendrick to steal possession deep in the Wales half before delivering a cross from the right flank which was expertly finished first time by McClean.
Goals elsewhere brought more bad news for Wales as Croatia - their potential rivals for the final playoff spot - took the lead against Ukraine in Group I and Serbia broke the deadlock against Georgia to strengthen their hold on top spot in Group D.
Wales - semi-finalists at Euro 2016 just last summer - suddenly found themselves needing two goals to reach the playoffs, while Ireland knew that conceding just once without reply would see both teams crash out in what had effectively become a winner-takes-all encounter.
A period of attack versus defence ensued, but Ireland's game management kept Wales at bay as they held out for a famous result despite late sights of goal for both Jonny Williams and Ramsey.
Ireland will now take part in the playoffs next month, with the draw due to take place next Tuesday as Martin O'Neill's side look to reach the World Cup finals for the first time since 2002 and just the fourth time overall.