Use FindLookAtRotation, plug your camera world location and your target world location then subtract your camera world Z-rot to the FindLookAtRotation result Z-rot.
Example:
Camera location (0,0,0) target location (0,1,0). FindLookAtRotation will output 90 deg Z because the target is directly on your right side. If your camera is looking at Rot(0,0,-90) then it is looking on opposite side which is 90-(-90) = 180 deg.