Wire is wire - just make sure you connect each wires to the same contact on both connectors and it will work.
Also please note that TRRS connectors will short so this cable should only be plugged in or unplugged while the keyboard isn't powered on or you might damage the controller chip.