Wu beat compatriot Ding, 39. Ding, the first player from China to win a ranking event, made 52 to take the opener, but breaks of 70, 61 and 59 helped Wu to a 3-2 lead. Ding answered with 133 and 91 to lead 4-3 and later stood 5-4 up, only for Wu's breaks of 107 and 77 to end the match and set up a repeat of the world final.
The 2022 champion, 40, was playing only his third match in seven months after struggling with mental health issues and withdrawing from a number of tournaments.
He then said he was good enough to win the competition for a second time.
"There's no reason why I can't win it, I'm as good as anyone left in the tournament,"Allen told BBC Two.
Asked what he had expected before the event, Allen said:"I genuinely just hoped I would be able to compete in round one.".
After an earlier defeat, Allen said in an emotional interview on TNT Sports that he expected to quit the sport.
Allen will play Zhang in Friday's quarter-final, which begins at 19:00 GMT.
Zhang, 34, has reached the UK Championship quarter-finals for the fourth year in a row, but has gone out at that stage in each of the past three seasons.
Elsewhere, Trump, 37, beat O'Connor 6-2. Trump lost the first frame, then made breaks of 66, 87 and 74 to take four frames in a row.
O'Connor, 31 and ranked 32nd in the world, had come through two qualifying rounds and a deciding frame against world number 12 Chris Wakelin. On Thursday he made 98 after missing the black for a century, scored only 65 points across the next four frames, and made 101 in frame six before Trump won the next two. Trump had been world number one for two years until the end of August.
Zhao, 29, has been world number one since the end of August, but will lose that position to Wu if Wu reaches the final. Zhao's only half-century in his last-16 match was a run of 60 in frame five. O'Sullivan beat Robertson to reach the quarter-finals.