It would be better to have at least 5 1/2 feet on each side. That would be 14 1/2 X 18. That way you wouldn't be scrunched or hitting any walls on your backstroke. Any smaller and the wall will be in the way and you would need to jack up or use a shorty cue.
5 ft from the outside edge of the table is plenty of room to be able to stroke if the cue ball is against the rail. 5 1/2 as mentioned above would be ideal from inside rail tip,