Media playback is not supported on this device
Selby opened with a break of 119, and at 3-0 up had scored 297 points, with the world number four managing just four.
Higgins pinched frame four, the start of a four-frame burst, but Selby responded and went on to win an error-ridden decider set up a semi-final with world number six Shaun Murphy.
In the evening session, five-time UK champion Ronnie O'Sullivan beat world number 16 Mark Williams 6-2 to set up a semi-final against Hong Kong's Marco Fu, who came back from 5-2 down to beat Welshman Jamie Jones 6-5.
Murphy scored three half-centuries and a ton to beat Belgium's Luca Brecel 6-1.
World champion Selby, who is into the last four at the York Barbican for the fourth time in the last five years, joked the result was "never in doubt".
"At one stage I felt I was throwing it away," he said.
"I was 3-0 up and playing well but I missed an easy red when I just needed red and black to go 4-0 up when I was in control. And the game doesn't forgive you.
"John started well and at 4-3 down I thought I was going home and I would only have myself to blame. I was getting chances but missing them. But I got through in the end."
Higgins said he was "gutted".
"I would have rather lost 6-0 than 6-5," he added. "I could have been halfway home by now."
Murphy, champion in 2008, was far too strong for Brecel, and reached the semi-finals here for the first time since 2012.
The 34-year-old looked slick and confident with his break-building throughout, scoring three half-centuries and a brilliantly compiled 112 in frame three.
But once again Murphy was not happy with the fact players do not get a new set of balls for each match, saying it affects the quality of play and is unfair to fans.
Find out how to get into snooker, pool and billiards with our fully inclusive guide.
"It's disappointing that the conditions were so poor," the Nottingham man said. "But my game is in good shape. I knew it was but have kept running into superheroes this season. But is has stood up here."
Murphy had lost 4-0 against his 21-year-old opponent at last month's Belfast Open, but was in control throughout in the best-of-11 meeting.
"I am very pleased," said Murphy. "I knew Luca was not to be messed with, going all the way to Belfast and scoring just eight points. It's a good win."
Sign up to My Sport to follow snooker news and reports on the BBC app.
World number one Mark Selby resisted a brilliant John Higgins fightback to win the last two frames and beat the three-time champion 6-5 in the UK Championship quarter-finals.