Specialists help, if you're too overextended to research competitively. Picking a few cities to staff with a Scientist and/or a Merchant can boost your tech rate and patch some economic holes. The much-maligned Mercantilism can help (free specialist.) I find Mercantilism in the early Middle Ages is usually a good stopgap while recovering from Classical expansion. It might look pricey as a choice in the Civics screen, but it pays itself back with just a few merchants.
Popping useful Great People, instead of all noisy Prophets, is a nice plus from that. (They can really help with the research gap.)
Hear, hear. This is key. If you beeline expensive techs, you can quickly backfill all your old-tech gaps this way, as well as trading for singleton newer stuff . As much as possible, find civs with money for the backfill trades, since they'll routinely give you all their cash as well as the older techs, in return for one new innovation. That cash lets you keep running research at a loss. Rinse, repeat.
Once you've backfilled, you can occasionally resell that older stuff to the real backwater military civs for a chunk of cash. But you have to check each round, since AI's don't hold on to cash for very long. Those pools of cash go straight into deficit spending (unless you need a quick border upgrade, like a few longbows out of archers or somesuch.)
An important side effect of using loss-trades to backfill is that you quickly pick all the worker and city upgrades you might be missing (everything from Cottages to Plantations to whatever else you skipped) and that itself starts helping get you back on your feet.
(I have a Metal Working fetish. I always reach for Metal Working very early; Forges are lovely, and you can trade MetalWorking for all the ancient/classical techs you skipped to get to it, even after waiting a bit.)
There are usually a cluster of second-tier civs furiously boosting one another up the tech tree this way; join them.
Typically the civs you don't want to tech trade with are runaway tech leaders - don't help them - and your nearest Montezuma-style neighbor.
The rejiggered relationship between cash and techs put me off tech trading for a while, but it's still essential, and you can still use it to play catchup, not unlike the way you did in CivIII.