"I had chances in the first frame and could have won the second. But I managed to level the match before the interval which was great. He was in a good rhythm and cueing well, and he has a good long game.
"I tried to play better safety when I was trailing and as a result I got more easy chances, then kept scoring to retain my form. Martin was still dangerous even when I was 4-2 up because he was quite relaxed. I managed to hold myself together through to the end.
Selby made 50, 76 and 65 on his way to leading 3-0 before Michael Holt levelled at 3-3. Selby won the final two frames including a 50 in the eighth frame to complete a 5-3 success.
Selby will now meet Fergal O'Brien for a place in the last four.
"It was a difficult game because Michael is a great player and one of my best friends on the tour," said Selby. "There's a long way to go yet but I'd love to play Ding in the final."
O'Brien completed a 5-3 win over Zhao Xintong, the wildcard had ousted Matthew Selt and Marco Fu in previous rounds.
Alan McManus continued his fine form. After a 5-3 win over favourite Ronnie O'Sullivan, McManus was a 5-1 winner over fellow Scot Stephen Maguire.
He will face Stuart Bingham for a place in the semi-finals.
"It was just my night tonight, I kept Stephen off the table for the first three or four frames," said McManus.
"That laid the foundations. Stephen has a problem with his leg and is not moving as well as he'd like so hopefully he'll get that rectified soon.
"Things went my way tonight, I didn't play great but I didn't miss too many. I've been winning matches in tournaments and it would be nice to go a bit deeper, though the deeper you go the tougher it gets.
"I've been here for five days so I'm more acclimatised and feeling more comfortable. I'll go and play my game and see where it takes me."