Simply put the i5 2nd generation has 2 extra cores than the i3, although the i3 may have a minute higher clock speed than the i5. However, the i3 4th generation has better compatibility with newer technology.
Taking a common i3 (4370) and i5 (2500K), the 4th gen will have a higher per-core score, but the 2500K is no slouch (and could be overclocked for even more performance).
If I had a 2500K, I'd keep the 2500K. If you're looking for a future build, the i5-4590 (non-overclockable) can be had for not much more than an i3 ($159 vs $139).