My personal suggestion would be the i5. There are a lot of people who have pigeon holed the i5's as 'gaming' cpu's and while it's true they're good at gaming, they're performing chips period. Whether it's a game or anything else. In other words, it's not 'just' a gaming cpu. As others said, the only time an fx 8xxx or 9xxx comes close or slightly outperforms are in rare instances where a program uses all 8 cores. Because they've made them so affordable (by comparison of the i7 6/8c cpu's) people are throwing 8 core cpu's in their systems all the time these days without fully understanding why or because they're under the assumption this makes them faster. I'm not trying to say an 8 core amd won't handle gaming or other tasks, it will. But it's unnecessary. Just as much as it's unnecessary for most folks to slap a 6-8 core i7 in their general use pc. Often they don't due to the higher price.
If the i5's are within your budget, that's what I'd recommend as a first choice. If you can afford a bit more and your needs involve moderate to regular video encoding or a lot of use with graphics programs (photoshop, illustrator, cad), then a xeon (locked) or i7 may be better. If your budget won't stretch that far, then go with amd. If it were me and I was planning to overclock the amd, I'd probably opt for the 6 core. Some amd motherboards have a hard time supplying enough voltage for good overclocks on 8 core cpu's and the 8 cores tend to generate more heat (more cores, higher clocked - higher power needs, more heat to get rid of).