sbush,
You will need to find Nps-3.5 pipe (4.0 inch od.) to thread and fit into the 4-UN thread. It will not be leak tight, so a flange + gasket, or a counterbore + O-ring seal would be needed for pressure tight joint.
Easiest thing is to get a machine shop to make an adapter to transition from 4" 8UN to 4" NPT instead of messing with flanges and o-rings. Easy greasy.