That inevitably happens, splunge. One city just can't keep up with other empires. Wth savvy tech trading (for things like Chemistry and Metallurgy) you can usually get to the industrial age okay, and then beeline either Industrialization (Universal Suffrage) or Sci Method (ToE) depending on how safe you think ToE will be.
Assuming you got the Great Library, it's usually a decent technique in OCC to just shut down research after Theology (or research Printing Press and then get almost all the way there on Education and then wait a bit and see). Then, with some cash in the bank, my preferred path is usually Education - Astronomy (grab Copernicus early enough and the research time to Shakespeare's is not much if any longer) - Banking-Demo-Free Artistry (for Shakes). You can usually trade along for the likes of Gunpowder and Chemistry from semi-backward AI, or if needed Democracy usually makes fine trade bait. Then onward to Newton's and hopefully trade for Metallurgy and maybe Magnetism, though it's likely that you won't be the first to ToG--but hopefully you can be first to Newton's.
Still, for a 20k win, most of the heavy lifting as far as culture is already done, and it's more a matter of keeping the AI from deciding to kick your ass.