First of all that i5's speed is 3.4GHz stock, and 3.8Ghz on max turbo.
The FX 4170 is rated at 4.2GHz stock/4.3GHz turbo.
The i5 is much more powerful than the FX 4xxx series chips. This is because, even though they have 4 cores just like the i5-3570, and that too rated at higher frequencies, the AMD cores are considerably much more weaker.
A current AMD FX core has only about 55% the performance of an Intel core, if both cores are run at the same speed. In other words, AMD cores have only 55% the IPC (measure of the amount of work done/GHz) of the Intel chips. So, even though AMD clocks the chips real high, it still can't keep up with the i5.
On an average basis, expect the FX 4170 to have only about 70% of the performance of the i5. However, the AMD chips are not a bad deal for those on a budget, because the i5 costs nearly $110 more than the FX-4170!!! AMD chips are really value for money
If your looking for an AMD chip in the $190 range, then get the FX-8350. Although this chip has the same kind of weak cores, it has 8 of them, so if you run properly threaded modern stuff, or are a heavy multi-tasker, they should perform on the same level as the i5, if not better, and that too for around $30 less