Gilbert took a tactical first frame 65-14 before a break of 60 was enough to open up a two frame advantage.
The ‘Jester from Leicester’ levelled the tie with runs of 62 and 38 before making an 88 in the fifth frame to take the lead but Gilbert roared back with an 65 to ensure the semi-final went to a decider.
Selby ensured his place in the final with a break of 111 where he will face namesake Williams.
Trump out despite 125 break, Higgins through
20/07/2013 AT 20:43
Williams, who overcame Stuart Bingham 4-2 in his quarter-final, was also taken the distance by Gary Wilson.
Wilson took three of the first four frames to open up a 3-1 advantage to put himself in touching distance of a spot in the final but former world champion Williams ground out a tactical fifth 68-19 before breaks of 71 and 63 confirmed his spot in the final.
Semi-final results
Mark Selby 4 - 3 David Gilbert
Mark J Williams 4 – 3 Gary Wilson
Snooker star Ali Carter gets the cancer all clear
19/07/2013 AT 20:33
'Much bigger than beating Ronnie' – Hill celebrates greatest triumph at Q School