I don't play Deity level, but these comments are about a Science Victory overall.
First, how far are you behind? Assuming Gathering Storm and later, how many projects have you finished? Do you have any Great People to speed up the projects?
As
@InsidiousMage wrote, how far is the AI ahead? Have they launched yet?
A key insight: Once the spaceship is launched, it becomes a numbers game. The ship needs to travel 50 LY, starting out at 1 LY per turn. Each laser station that is built adds speed, so that it can go 4, 6, 7 LY per turn. The AI rarely build these accelerators, but you can (and should). Each city with a spaceport can build a terrestrial laser station and (at least) two lagrange point stations. Maker sure that you've built the Royal Society and that you have a pile of builders streaming towards your Spaceport cities.
Approximate math: if the AI ship launched 10 turns before yours, but you have 3 Spaceport cities, you could build 6 laser stations (one of each kind) to get to 7 LY per turn. Overtaking the AI ship is possible. If the AI ship launches 15 or more turns before yours, you would need even more Spaceport cities and workers. The numbers may not work. Fewer than 10 turns, you should be able to overtake the AI ship.