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.
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.
It looks like it from the picture, but I can't find anything definitive about it, and the online manual mentions USB devices but doesn't specifically say USB-MIDI devices. My guess is that as long as the USB-MIDI devices are class-compliant then it ought to work.