If your budget does not allow you an i7 or Xeon CPU (even a 4000/Haswell series would suffice), I would urge you to consider an i5 6400 and push it with overclocking. Though if overclocking is not an interest of yours, it's not as daunting as it seems, I would push you towards the i5 7400. Keep in mind Kaby Lake does not support Windows 7 or 8(.1) if you planned to install either of those OS. Yes, it can work but it is not supported and you may run into issues. Kaby Lake would need to run Windows 10. If that is of no concern, the 7400 is pretty much your go to.
If you decide overclocking is something you would like to do, consider a build like this:
PCPartPicker part list /
Price breakdown by merchant
CPU: Intel Core i5-6400 2.7GHz Quad-Core Processor ($176.69 @ SuperBiiz)
CPU Cooler: CRYORIG H7 49.0 CFM CPU Cooler ($34.88 @ OutletPC)
Motherboard: Gigabyte GA-Z170X-Gaming 3 ATX LGA1151 Motherboard ($133.05 @ Amazon)
Memory: GeIL EVO POTENZA 16GB (2 x 8GB) DDR4-2400 Memory ($89.89 @ OutletPC)
Total: $434.51
Prices include shipping, taxes, and discounts when available
Generated by PCPartPicker 2017-01-30 13:47 EST-0500
Substitute the Cryorig H7 for their C7 if you need a low-profile cooler for a narrower case.
The reason I've chosen the i5 6400 is because it will overclock above 4Ghz and perform better than either CPU you listed above. You can overclock the 6500 as well, though because they are the same CPU, just set at different speeds, you will just be spending more money on a stock speed you will be changing with your overclock regardless.
The way this overclock works, is by flashing your BIOS with an older version. This previous version allows for changes to the base clock (BCLK). The reason this overclock is so effective, and why I recommend the 6400 specifically, is because it
only works with Skylake/6000 series CPUs. Normally the BCLK effects the entire motherboard but in this case it only changes the CPU and RAM frequencies. To make sure your RAM doesn't become unstable, you simply lower the multiplier.
This link will show you how to do it and have a link to the BIOS version you need: http://overclocking.guide/gigabyte-z170-non-k-overclocking-guide/