Seven-time world champion Hendry looked set for a place in the semi-finals after the Scot used all his experience to move to within a frame of victory over his 24-year-old opponent. But left-hander Allen then won the next three frames.
Hendry had produced a break of 126 to level the match in the second frame, but subsequently managed a high of just 36 as Allen gradually found his touch.
Allen's win set the scene for a last-four meeting between two of snooker's brightest young talents with local hopeful Ding having turned 23 only yesterday.
"To play Ding in China is the sort of game we practice for," said Allen. "There will be a big crowd and good atmosphere, and with two young, attacking players it should be entertaining."
Ding delighted the home support with a 5-2 win over defending champion Peter Ebdon. Ding stormed into a 4-0 lead with breaks of 93, 121 and 92, but former world champion Ebdon typically dug deep to win the next two frames before Ding closed out the seventh frame 81-0.
In the afternoon's quarter-finals, Mark Williams and Ali Carter progressed with comfortable 5-1 victories against Marco Fu and Mark King respectively.