the i5-6400 is slightly better (generally, not always), but an older architecture.
If you're building a new rig I'd personally go with the i3-6100 on a skylake build, but if you still have an 1150 rig the i5-6400 would be the way to go.
Here's a video comparing the two with plenty of different games: https://www.youtube.com/watch?v=YZywuIvaxd0