Yes, but you need a special interface that can act as a USB host; or you could just connect both of them to a computer or laptop if that's acceptable to your situation. For instance, you might prefer to use an interface if you need to connect them together during a live performance on stage, or you might prefer to just use a computer if the setup is in your home or a studio and can remain as is rather than needing to be put up and torn down in a hurry.
Examples of interfaces that should be able to do this are the
Kenton MIDI USB Host MkII, the
Sevilla Soft USB HOST MIDI 2 or
USB HOST MIDI ROUTER, the
Miditech USB MIDI Host, and some of the
MIDI interfaces from iConnectivity (the ones that include a Type A USB port, rather than just a Type B USB port).
Note that the device which has a USB-MIDI port (in this case, the Yamaha P-105) must be MIDI class-compliant so it doesn't need a USB-MIDI driver. If the P-105 doesn't meet that requirement then you'll need to connect it to a computer and install the appropriate USB-MIDI driver for the computer's operating system, then connect the Korg X5D (or is it the X5DR?) to the computer using a MIDI-to-USB interface cable, and use a MIDI routing utility or a DAW to pass the MIDI data from one keyboard to the other.