Just do as WAS says -- add a transform input shader between the image map and the default shader, then adjust the Y axis to rotate the image on the background sphere.
If you can export the skysphere out of UE4 as an image (exr or radiance works best), then you should be set. (Proportions should be 1:2 as WAS mentioned.) See attached tgd file for an example. Note that you must have one of the following buttons selected to view the background in the 3D preview: Shaders, Water, Atmosphere, Lighting, or Renderers. (The background will not appear if you have RTP selected.)
If I might ask, what are you trying to accomplish here? For what it's worth, Terragen excels at creating atmospheric effects and skyscapes. That's one of the things it's designed to do. Most people would use TG to create skyboxes to be used in other applications, games, and animations. Not the other way around.
You can probably create the skybox you need right in the Terragen itself. If you are new to the program, please take some time to acquaint yourself with it. The wiki is packed with useful information, and there are plenty of good video tutorials (
https://planetside.co.uk/terragen-terratuts-tutorials/). And don't hesitate to ask questions here on the forum. (And post renderings when you start to work on projects.)