You might want to remember that when dealing with products of transposed matrices, the following formula applies:
(AB)T = BT * AT
EDIT: Proof here: http://www.proofwiki.org/wiki/Transpose_of_Matrix_Product
And for multiple products of transposes
(A1A2...An-1An)T = AnT * An-1T * ... * A2T * A1T
Which is very similar to the product of inverses formula too (replace AT with A-1). The inverse formula is trivial to prove.
EDIT2: So, since your X, Y, Z rotation matrices are transposed, you should find that XTYTZT = (ZYX)T
i.e. your XYZ rotation matrix will be the other library's ZYX rotation matrix, transposed.