Young stellar object observations suggest that some jets rotate in the opposite direction with respect to their disk. In a recent study, Sauty et al. showed that this does not contradict the magnetocentrifugal mechanism that is believed to launch such outflows. Motion signatures that are transverse to the jet axis, in two opposite directions, have recently been measured in M87. One possible interpretation of this motion is that of counter-rotating knots. Here, we extend our previous analytical derivation of counter-rotation to relativistic jets, demonstrating that counter-rotation can indeed take place under rather general conditions. We show that both the magnetic field and a non-negligible enthalpy are necessary at the origin of counter-rotating outflows, and that the effect is associated with a transfer of energy flux from the matter to the electromagnetic field. This can be realized in three cases: if a decreasing enthalpy causes an increase of the Poynting flux, if the flow decelerates, or if strong gradients of the magnetic field are present. An illustration of the involved mechanism is given by an example of a relativistic magnetohydrodynamic jet simulation.