Yes they will swap over, same goes for 351W heads on a 302.... A stock 302/5.0 head is way to small for a 351W though..
A 302 head will only fit on a 351W if you drill the head bolt holes out to 1/2" from the stock 7/16".
A 351 head will fit on a 302 if you use the stepped head bolts/studs or the t-washers that convert from a 1/2" hole to a 7/16".