O'Sullivan admitted afterwards that he felt slightly fortunate to win a match in which he scored his 973rd career century but in which his opponent also enjoyed some impressive breaks.
"I just felt lucky I won there," he told Eurosport. "I felt like I was the second best player there tonight. He had first chance every frame, I just managed to pick off his scraps."
He added: "I don't doubt myself but you have to be honest sometimes, he had chances and if he had been scoring it could have been 5-1 the other way.
"You just can't afford to miss silly balls. If you want to win and win on your terms you can't miss them and I'm relying on other people making mistakes. I don't try and analyse it too much anymore, I just pitch up ten minutes before I'm playing and just hope for the best."
Selby had earlier beaten Thepchaiya Un-Nooh 5-3 to secure his own spot in the final four.
Un-Nooh took the first frame with 88 points and a break of 80, the highest break of the match.
The pair matched each other frame for frame until the fifth when a slip up by the Thai player allowed Selby a chance to score 122 with breaks of 52 and 56, giving him a 3-2 lead.
At 55-5 in the eighth frame with a 4-3 advantage, Selby gave Un-Nooh a way back in.
Selby makes classy century in win over Un-Nooh
However, it was an abrupt end to the match as Un-Nooh subsequently potted the white, giving the World No.1 a score of 59-5 in what would be the final frame.
“I felt the table played really heavy out there," Selby told Eurosport. "The other day I felt it sort of getting a bit more heavier and today was really difficult. When you were close and in the balls it was okay but anything where you’ve got to manoeuvre the white was a real struggle."
"If I play Ronnie it will be a fantastic occasion," Selby added, before his opponent was confirmed.
No matter what tournament you play him in, he's probably the best player to ever play our game and you want to play against the best players. So if it is Ronnie I will look forward to it.
Meanwhile, Judd Trump got past Ryan Day in a thriller, wrapping up his 5-3 win in style with a century break.
'What a talent he is! - Trump rattles in 120 break to finish off Day
Trump will take on Eden Sharav, who edged a fascinatingly poised encounter with Peter Ebdon 5-4.
- Mark Selby 5-3 Thepchaiya Un-Nooh
- Judd Trump 5-3 Ryan Day
- Ronnie O'Sullivan 5-2 David Gilbert
- Eden Sharav 5-4 Peter Ebdon