If the board fits the space you have, you just need to get some insulated circuit board "stand offs"..
Drill new holes in the electrical box matching up with the holes in the new board.
Something like these?
Found those
HEREIf you can dig around might be able to find insulated standoffs in different lengths and even threaded screw mounts instead of snap ins.