No different than any other gateway. You'd point the DN's for the FXS ports to the sip gateway.
You'll have to see this as having two separate systems, it will require call routing from both ends to get it working. Again though, no different than any other sip integration.
Have you considered running fiber to that remote connection, installing a POE switch and giving users IP phones?
If that's not an option for you for some reason, have you considered and cisco FXS gateway instead? It might save you some trouble.