I do not know how to put the vertical line there other than through a background line.
That said, you can put a given space by putting a right indent where you want the dot leader (or text) to stop that is inside the right-tab stop for the page number.
This is dealt with in this article:
TOC Tips and Tricks by Suzanne Barnhill, MVP
See the part on Indents and Tabs. This would be a modification to the paragraph formatting in the relevant TOC styles.