Nope, it's first and foremost a science victory. You need some production, but given the time it takes to get through the tech tree, you have time to get up Industrial Zones with all buildings in every city around your spaceport(s) in time. As long as you don't build lots of unnecessary stuff. Go through the upper part of the tech tree first to unlock everything for IZ, spaceports, the moon landing and the first mars module. Then you have plenty of time to build your spaceport(s) and the first couple of projects while teching the lower part of the tech tree.
Lots of early campuses are important, not only for teching, but for GS points. The three iInformation era Great Scientists give +3000 production towards space projects, +100% production towards space projects and all information era eurekas. They are all extremely good, but you need lots of GS points to unlock them early enough. Great Engineers can give you +1500 production, +20% and +100% production towards space projects. If you get all Scientists and Engineers, you don't need any production at all, except to build one spaceport, since the Great People take care of all Space Projects. The 100% boosts also apply to the +3000 and +1500 boosts to make them +9000 and +4500, or more. Overflow is infinite, so +9000 would build all three mars modules.
You can also leave some forests and production resources to harvest around your spaceport. In the late game they are worth a lot of production, and this production is multiplied by whatever modifiers you have towards space projects. I sometimes build a spaceport at the edge of my empire close to tundra, if there is lots of forests in the tundra that would go to this city when chopped. Depending on your modifiers, 5-10 forests should be enough for a mars module.