If the motherboard is a socket LGA1151 which is the same as the i5 6400 then it should work. However you have to use DDR3l ram. If you check the intel website for that CPU, it only supports DDR4 and DDR3l RAM. My suggestion is buy a DDR4 motherboard with the socket LGA1151 and buy DDR4 RAM. Hope...