Is it permissible to settle one’s debt using prohibited money such as from the winnings of a lottery?
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
Debt is an ownership of something on loan to another person on the condition that the person returns it without any additions. 
Debt is a responsibility that must be repaid, however, the aim of settling one’s debt doesn’t make prohibited matters permissible. The means to an end of settling the debt shouldn’t be from prohibited sources such as through stealing, gambling, robbing, lying, and others. The reason is it is impossible for something obtained from a prohibited source to be made permissible by giving it to another or rewarded for. A Muslim should be careful to ascertain the permissibility of his sustenance source and how it is spent. This is crucial to be understood by every Muslim. From Abu Barzah al-Aslami RA< the Prophet PBUH said:
لَا تَزُولُ قَدَمَا عَبْدٍ يَوْمَ الْقِيَامَةِ حَتَّى يُسْأَلَ عَنْ عُمُرِهِ فِيمَا أَفْنَاهُ وَعَنْ عِلْمِهِ فِيمَ فَعَلَ وَعَنْ مَالِهِ مِنْ أَيْنَ اكْتَسَبَهُ وَفِيمَ أَنْفَقَهُ وَعَنْ جِسْمِهِ فِيمَ أَبْلَاهُ
“Man’s feet will not move on the Day of Resurrection before he is asked about his life, how did he consume it, his knowledge, what did he do with it, his wealth, how did he earn it and how did he dispose of it, and about his body, how did he wear it out.” 
Thus, we have to ensure that our sustenance is from permissible sources as well as the permissibility of how and where it is spent. We are taught to find our sustenance and food only from permissible sources. This follows a famous hadith from Abi Hurairah RA, he said: The Messenger PBUH said:
إنَّ اللَّهَ طَيِّبٌ لَا يَقْبَلُ إلَّا طَيِّبًا، وَإِنَّ اللَّهَ أَمَرَ الْمُؤْمِنِينَ بِمَا أَمَرَ بِهِ الْمُرْسَلِينَ فَقَالَ تَعَالَى: “يَا أَيُّهَا الرُّسُلُ كُلُوا مِنْ الطَّيِّبَاتِ وَاعْمَلُوا صَالِحًا”، وَقَالَ تَعَالَى: “يَا أَيُّهَا الَّذِينَ آمَنُوا كُلُوا مِنْ طَيِّبَاتِ مَا رَزَقْنَاكُمْ” ثُمَّ ذَكَرَ الرَّجُلَ يُطِيلُ السَّفَرَ أَشْعَثَ أَغْبَرَ يَمُدُّ يَدَيْهِ إلَى السَّمَاءِ: يَا رَبِّ! يَا رَبِّ! وَمَطْعَمُهُ حَرَامٌ، وَمَشْرَبُهُ حَرَامٌ، وَمَلْبَسُهُ حَرَامٌ، وَغُذِّيَ بِالْحَرَامِ، فَأَنَّى يُسْتَجَابُ لَهُ؟”.
“Allah the Almighty is Good and accepts only that which is good. And verily Allah has commanded the believers to do that which He has commanded the Messengers. So, the Almighty has said: “O (you) Messengers! Eat of the tayyibat [all kinds of halal (legal) foods], and perform righteous deeds.” [23:51] and the Almighty has said: “O you who believe! Eat of the lawful things that We have provided you.” [2:172]” Then he (ﷺ) mentioned [the case] of a man who, having journeyed far, is dishevelled and dusty, and who spreads out his hands to the sky saying “O Lord! O Lord!” while his food is haram (unlawful), his drink is haram, his clothing is haram, and he has been nourished with haram, so how can [his supplication] be answered?” 
Tayyib means free from any deficiencies. It is said tayyib is one of the attributes of Allah. 
We emphasize that the ruling of settling one’s debts with money from prohibited sources is prohibited even when the purpose is to pay his debts. We end with the supplication:
اللَّهُمَّ إِنِّي أَسْأَلُكَ عِلْمًا نَافِعًا ، وَرِزْقًا طَيِّبًا ، وَعَمَلاً مُتَقَبَّلاً
“O Allah, I ask You for knowledge that is of benefit, a good provision, and deeds that will be accepted.”