Short answer. Yes.
Tons of people have done this swap (including myself).
The long blocks are the same. The difference is what is bolted onto the motor and the PCM programming.
Suggestion. Put both motors on an engine stand. This will make swapping easier. Be sure to use the Mustang's wiring harness, fuel injectors, exhaust manifold, oil pan, EGR system. In short. Make it look like the old motor.
Remove the knock sensor from the CV. The Mustang doesn't use it.
Get new motor mounts. The Mustang is very hard on motor mounts. There will never be an easier time to install new mounts.
If the CV motor has an external oil cooler (police/fleet) remove it. Swap over the Mustang's oil filter adapter.
Take tons of pictures of each motor.
There are other possible minor differences with things like the PCV hose diameter, heater hoses and such but they are not difficult to over come.
If switching from manual/automatic or automatic/manual, then add or remove the pilot bearing as needed. Same goes for the flex plate or flywheel.