Hmm...well, without knowing your situation any more than what you've said, here's what you can do.
Are you familiar with the notion of prebuilding? What you will want to do is to start building nukes (or anything else that has a really high shield cost) in the cities you want to build space parts, and when you get the tech in, switch from the nuke to the ship part. The AI is notorious for being unable to finish a space race, with some smart prebuilding you can catch up in ship production since the AI will never start building a space ship part until it has the tech to build it.
What government are you in? I assume either Democracy or Republic. If you aren't and you're a religious civ, it will be trivial to switch back into it (unless you still have a lot of rails to fill in, Republic is probably better than Democracy for war weariness purposes). Secondly, how much gold can you generate? Do all of your most productive cities have markets/banks/stock exchanges in them? If not, you'll want to make the time to build them (and if you can't make the time, run low science for a bit and rush them). And for gaining ground on tech, in the Modern Age it might be cheaper for you to go with zero science and use Espionage to get your tech (always use the Safe option, you don't want to risk your spy just to save a few bucks...you do have a spy in Egypt, right?), this is especially true for the higher difficulties. Either way, you're best off either researching it or stealing it, that way Egypt won't be receiving any of your cash.
The time to panic is not when the AI has three parts done. The time to panic is when they have 7 or 8 parts done and you're just starting on your ship. That is when you want to have a force of Modern Armors and ICBMs ready to nuke and raze their capital so they have to start over again (prepare to be nuked in retaliation if you do start letting them fly). Spend some cash at your embassy to see how easily you can take out their capital and to find out where their Apollo Program is if it isn't in the capital. Check around the map and try to find their sources of Aluminum and Uranium. It sounds doubtful since it sounds like Egypt controls about half the globe, but if you can take out their uranium and aluminum sources, they won't be able to build ship parts.
So to recap:
-Prebuild
-Increase your cashflow
-Never buy your tech from them, either use your own research or steal it (especially when only one civ has the tech already, and especially in the modern age).
-Save the nuke-and-raze tactics as your last resort, often the AI will just never get around to building the last piece or two and snatch defeat from the gaping jaws of victory.