How close can CAT6 run to electrical?
CAT6, even "unshielded", is very resistant to electrical interference, just as it can carry very high-speed data while emitting little or no interference. Plus, your power cables have pairs of conductors carrying current in opposite directions, so any interference they emit is going to rapidly diminish with distance.

(For fun, here is an explanation of how CatX cables reduce crosstalk and increase EMI resistance.)

In real terms, 4" is plenty of spacing, even if you ran the two lines parallel for much longer distances.