However, parity lasted just three minutes before Swansea regained their lead, and there was no way back for Wolves as they crashed out in the third round to bring an end to their 14-match unbeaten streak across all competitions.
Swansea, meanwhile, have won for just the second time in their last nine outings to set up a fourth-round meeting with Notts County.
The match pitted bottom of the Premier League against top of the Championship and, while the formbook was with Wolves, it was Swansea who had the first chance of the match when Ayew won possession in a dangerous position, only for his touch to let him down.
There was nothing wrong with Ayew's touch moments later, though, with the striker dancing past several Wolves defenders on his way into the box before firing his finish past the onrushing Will Norris to cap off a fine solo effort.
The hosts came close again midway through the first half when Wolves could only clear the ball as far as Roque Mesa on the edge of the box, but his subsequent volley flew wide of the target.
Wolves threatened for the first time moments later when Bright Enobakhare latched on to an incisive pass from Morgan Gibbs-White before trying to round the goalkeeper, only for Kristoffer Nordfeldt to get a crucial touch on it to send it behind for a corner.
Swansea were soon back on the attack themselves, though, and it was Norris who had to make an important contribution five minutes before half time when he denied Connor Roberts following a through-ball from Wilfried Bony.
The Premier League side were being served constant reminders that a one-goal lead may not be enough, including one more just before the interval when Federico Fernandez made a goal-saving block to thwart Enobakhare.
Wolves began the second half on top too, and Helder Costa almost restored parity seven minutes after the restart with a sharp turn and shot which flew narrowly over the crossbar from the edge of the area.
The Championship outfit did get their equaliser shortly after the hour mark when Jota - only on as a sub for two minutes - raced onto Roderick Miranda's pass over the top before cutting inside onto his right foot and firing his finish inside the near post.
Wolves immediately set about looking for a second goal and Jota almost made it two in as many minutes with a 20-yard effort which went narrowly wide, but just one minute after that the visitors found themselves behind again.
A cross from Tom Carroll was not cleared by the Wolves defence, allowing Bony to poke home from close range for his third goal of the season.
Wolves went in search of another equaliser but squandered their best chances 10 minutes from time when Jota's initial shot was spilled by Nordfeldt, only for the Swansea keeper to recover in time to collect Leo Bonatini's follow-up effort.
It was actually Swansea who came closest to adding to the scoreline in the closing stages when Ki Sung-yeung flashed an effort across goal, but his shot went wide as the hosts settled for the one-goal victory.
SWANSEA (4-2-3-1): Nordfeldt; Roberts, Mawson, Fernandez, Naughton; Carroll, Mesa (Ki, 73'), Narsingh (Dyer, 73'), Ferm Ayew; Bony (Clucas, 79')
WOLVES (3-4-3): Norris; Miranda, Batth, Hause; Doherty, Gibbs-White, N'Diaye, Douglas; Costa (Saiss, 73'), Mir (Bonatini, 64'), Enobakhare (Jota, 64')