The Englishman, who is currently the world number two, led 3-1 before Zhang pulled level.
Wilson then claimed three of the next four frames to win 6-4.
Despite the defeat, Zhang's potting total eclipsed the reigning world champion.
But a focused Wilson was able to prevail in front of a rowdy London crowd.
"Every credit to Zhang, I thought he played fantastic," Wilson told Eurosport after his win.
"I've never seen such a consistent display of long potting - it wasn't like I was leaving a long one. It was a variety of different long shots that he was nailing every time.
"I was petrified every time a ball stuck out because he was just potting it. I had to hang on in there and nick the odd frame."
In the evening session, Belgian star Luca Brecel beat England's Chris Wakelin 6-3 to set up a quarter-final clash with Wilson.