Please don't be confused by the naming convention. Every architecture and die shrink (since its initial introduction) has had a Core i3, Core i5, and Core i7. It's mainly for the general consumer base - someone can obviously know nothing and guess that the i7 is better than the i5 and the i5 better than the i3.
When comparing i5s for example, quad-core > dual core, and the higher the clock frequency (GHz), the better (things like low voltage, LV, and ultra-low voltage, ULV come into play too, but let's just ignore that for now). But that's only valid for processors released in the same year (aka same architecture or same die shrink). You can't just say a 2009 Camaro is better than a 2012 Camaro because it has a bigger engine or something (I'm not a car person, just trying to make an analogy), perhaps the 2012 is more fuel efficient and has newer technologies? It's precisely the same situation when comparing CPUs across different generations.
Take for example this PassMark CPU benchmark for the 2.5GHz i5 in the 13in rMBP - it benches at 4000 (
http://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i5-3210M+@+2.50GHz&id=815)
Now compare it to this PassMark CPU benchmark for the 2.66Ghz i5 in your 2009 iMac - it benches at 3994 (
http://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i5+750+@+2.67GHz&id=772)
So in this case, they're close! But that's pretty amazing considering the processor in the rMBP is clocked at a lower frequency and is only dual-core! This will translate to equal performance, but less power consumption (especially considering the 22nm process and tri-gate transistor technology... and the fact that the iMac is a full-voltage processor (max TDP of 95W) where as the rMBP one is a low-voltage processor (max TDP of 35W)).
Hope this helps!