Just multiply the forces by the transpose of the kinematics Jacobian matrix.
$$ \mathbf{\tau} = \mathbf{J}^T \mathbf{F} $$