Based on the details provided, X is Arjuna and Y is Bhagadatta.
Arjuna had to go to Manipur to retrieve the sacrificial horse when it was stopped by the king of Manipur, Bhagadatta. In the ensuing battle, Arjuna was killed by Bhagadatta. Later, Arjuna's wife Subhadra used a gem that could revive the dead to bring Arjuna back to life.