Yes you will need a new motherboard because 8400 requires a newer version of the LGA1151 motherboard. If you install a i5 8400 into your board the system won't boot. You need the Z370 chipset for coffee lake.
and if you go to the 8th gen CPU, you'll want to upgrade your RAM to take advantage of the faster speeds available...and then maybe an SSD to replace that old spinny drive...