AMD as of now dominates the budget market. As everyone above has already said, the intel is better however more expensive when paired up with a good board. There is no one-fits-all philosophy where one cpu is better than the other, these both exist for a purpose, if the i5 was straight-out better than the fx would just downright stop selling.
Intel vs amd cpu will mostly depend your budget and especially what gpu you'll be using. Frame drops are far worse on the fx cpus than on intels haswell, mantle api itself does not benefit the 8 core fx alot
So, you need to consider three things
1) what is your budget? for a lower budget the fx is an unbeatable choice, for a higher budget the intel is a better choice
2) what gpu do you have? if you have anything that is as powerful as a gtx 780 or a r9 290/290x then you might want to consider the intel cpu, as mentioned before, frame drops are alot worse on amd cpus
3) what games do you play? if its anything the likes of skyrim and such with insane mods, the fx cpus 8 cores might edge out the i5s 4 cores
Sources: https://www.youtube.com/watch?v=qIT9uLDjZcg
https://www.youtube.com/watch?v=ICVeN6WEGgg