AFAIK, the heads on the ST4s engines were heavily revised to give clearance as the original 996 heads did not fit within the adapted 888 frame on which the ST series was based. The heads are much lower in profile than those on the 996.
Also, the 999 has the Testastretta motor, which though fitted to the 998, never saw usage in the ST line up.
So, to answer you, it may not be a straight swap, but it might be worth a try.
Also, you could take a pointer from the Monster S4Rs. It uses an adapted 999 engine in a frame based on the ST4 range, so it might give you some easily accessible answers for what you are suggesting.
A