Dutchman van Barneveld fought back from 3-1 down to win five of the final six legs, averaging 101.98 in the process.
"I'm very pleased," said the 44-year-old. "I struggled in the first couple of legs and at 3-1 down I knew I had to fight back, and I think I played really well.
"Andy was fantastic in the World Matchplay and we always have great battles when we play, and this was another. It was a great game to be involved in."
Van Barneveld now faces Mark Walsh in the last 16.