On the night Victor Moses, the most recent Eagles Academy graduate sold to the Premier League, returned to Selhurst Park on the Latics' bench, rookie midfielder Williams marked his second Palace start with his first career goal.
The Wales Under-21 international curled in a memorable strike from the edge of the penalty area to add to Darren Ambrose's opener as Palace grabbed a deserved cup scalp.
The Championship side also hit the woodwork twice in a dominant display against their top-flight opponents in the second-round clash.
Roberto Martinez may have made seven changes from the team beaten by Manchester City on Saturday and handed debuts to three players, but he will have expected far more from his side who barely tested Palace's back-up keeper Lewis Price until the final 20 minutes.
One of his new recruits, Chelsea loanee Patrick van Aanholt, rattled the crossbar with eight minutes left and former Eagle Ben Watson pulled one back in stoppage time, but by then it was too late.
Price, making only his third appearance in more than a year with the Eagles, made a nervous start when he threw the ball straight to the opposition in the first minute, but when it fell to debutant David Jones he blazed his shot over the top.
But for the rest of the first half it was all Palace.
They almost took the lead after five minutes when Ambrose drove in a low free-kick but Ali Al-Habsi got down well to save.
Palace were denied an opener in the 23rd minute when Dean Moxey's flick-on found Glenn Murray, whose half-volley crashed against the bar.
But 60 seconds later they went ahead when Wilfried Zaha raced to the byline and pulled the ball back for Ambrose to tuck past Al-Habsi from 10 yards out.
With their tails up, Palace almost went further ahead within a minute with Ambrose cutting inside and curling in a shot which forced another fine save from Al-Habsi.
And the second goal duly arrived on the half-hour, with Zaha again the creator.
His cross was only cleared as far as Williams on the edge of the area and the youngster lashed a first-time shot back past the unsighted Al-Habsi and into the net.
It could have been even worse for Wigan but Ambrose fizzed another drive inches wide, McCarthy's header was scrambled clear by Al-Habsi and Murray headed against the foot of the post.
Wigan, presumably with some stern words from Martinez ringing in their ears, made a more positive start to the second half and Jones fired an early chance over the top.
They almost pulled one back when Jones' shot was deflected wide after a goalmouth scramble, and then James McCarthy shaved the outside of the post with a half-volley.
McCarthy tried his luck from 25 yards with a shot which at least gave Price something to do, the keeper comfortably smothering the effort.
With eight minutes left Van Aanholt's fierce shot came back off the bar, and the Latics finally found the net through Watson's low strike, but the hosts held out for a deserved win and a third-round visit from Middlesbrough.