I just realized that the .gr2 skeleton is exported in the correct position, i.e., without a 90-degree tilt. It turns out I was exporting it correctly all along, but to attach it to the model in the game, I needed to tilt it by 90 degrees, and I didn't figure that out before.
It's amazing how everything is done in such a convoluted way...