Im still struggling at Noble difficulty and I often find myself seriously outteched with 5+ techs by some AI with 4 to 5 cities, on both normal and epic speed. The AI get techs faster than me despite that I have 2-3 times more cities and a higher research percentage. I'd think the AI was cheating if it wasn't for my difficulty setting. What is going on here? Some mad diplomacy skill?
What leader are you playing as, and what leaders out tech you? Some AI's like Mansa Musa are infamous for outteching anyone but a fellow Financial leader, simply because they build few units, trade techs a lot, focus on commerce and research and get +1

all over the place. He's usually more easily warred with though because his army is smaller than average. If you play a non-financial civ he can easily outpace the human player if he gets a cottage-friendly start location. Frederick is about the same personality if I remember my leaders right, very peaceable but a fast tech'er.
Even on emperor, if there's a leader you know likes tech'ing fast (especially Financial leaders) I either:
1) Never open borders with them for long (it might hurt me more than help but *shrugs* it sometimes blocks their trade routes)
2) Try and pass them some religion that no one else has as a State Religion, so the world hates them and doesn't trade.
3) If they're far from my lands, declare war early before they make powerful friends, build a small stack of counter-units (3 axemen, 3 spearmen, a medic and a horse archer for example) and go on a pillaging spree. The -1 diplomatic hit to a few other leaders is worth killing his economy early, and you get loads of gold to boot.
4) If they're close to my borders, declare war early, take a few major cities quickly and make them your vassal (or accept peace for some of their techs if the war starts wearing down your nation's time and resources too much). Most of the tech-friendly leaders have very small standing armies in peacetime. Don't go for totally wiping them off the map, they lead you in tech and their units will kill yours if you let them crank out units in full military mode too long, plus war weariness will set in.
Sometimes, if they're much more powerful than you military-wise it can be worth it to send in a pillaging force to them while you fight a defensive war on your territory. Them sending stacks at you will give them war weariness, tie up cities for building troops that could be building markets, and overall slow down their economy. They might even switch away from better economic civics. Going to war doesn't mean you have to wipe them off the map, or even take any cities. Let them come to
your heavily-fortified cities, where
your units can use road movement and heal faster in cultural borders, while you wreck their cottages behind their lines and they get most of the war weariness. This is even better if you can get the Great Wall.
Speaking of the great wall, another strategy that works for some people if you have Stone or the Industrious trait is going for the Great Wall as soon as possible, and using the Great Spy that pops out to infiltrate an enemy civ for something like 5,000 espionage points against them, which you can then use to steal 3-4 techs with regular spies.
If you're being out teched by all the AI leaders in general, try and focus on:
1) Hook up your cities to your capital as soon as possible with roads or sailing so your cities can trade; isolated cities cannot have a trade route.
2) Build more cottages at the earliest opportunity, and make sure citizens are at work on them so they grow (I often change what tiles citizens are working manually in the city window)
3) Might need to expand a little slower in the early game; I typically have just my capital and 3 other cities, maybe 4 at a stretch, for some time - depending on who my leader is. I've been playing the Dutch in BtS, so I generally go for an early Cultural-trait land grab, defend and build cottages + the cheap libraries, then start fighting neighbors in the classical and medieval age. Different leaders are better with different strategies though, when I used to play as Huayna Capek I'd build 7 Quecha right off and take 1-2 AI capitals rather than build settlers and cities.
4) Go for alphabet and trade techs with as many AI's as you can (without actually ever trading Alphabet away if possible. If one person has researched Alphabet, other civs are less likely to go for it as most techs have already been traded). You'll help each leader a little bit individually, but you gain a lot in total.
5) Try and get currency and courthouses early. Currency gives you +1 trade routes and allows you to build markets for +25%

.