Short answer
Yes. Nafl prayed at night after Isha counts as night prayer (qiyam al-layl) and is rewarded. In the strict sense, tahajjud is the prayer after waking from sleep, and that is better. If you pray witr before sleeping and then wake, you may still pray tahajjud in twos, but do not repeat witr.
The time for night prayer begins after the Isha fard and lasts until true dawn. Praying it after some sleep is the sunnah form and more rewarding, but nafl prayed before sleeping is valid and earns the reward of night prayer. Someone who prayed witr earlier prays tahajjud without a second witr.
The four schools agree on this.
Explanation
The word tahajjud comes from a root meaning to give up sleep, and the Quran praises those whose sides leave their beds at night to call on their Lord. So the ideal is to sleep after Isha and rise in the later part of the night. But the four schools agree that any voluntary prayer after Isha, before you sleep, is valid night prayer with reward. Many scholars say that if you know you will not wake, praying before bed is better than leaving the night prayer altogether.
Witr and tahajjud: the Prophet ﷺ said to make witr the last of your night prayer, and also that whoever fears he will not wake should pray witr early in the night. He also said there are no two witrs in one night.
- If you trust yourself to wake: delay witr and pray it after tahajjud.
- If you are not sure: pray witr after Isha. If you then wake, pray tahajjud in sets of two and do not repeat witr.
- No "breaking" witr: the Hanafi school does not add one rakah to turn the earlier witr even.
A simple routine: after Isha, pray the sunnah, then two or four rakats of nafl with the intention of night prayer, then witr if you doubt you will wake. Set an alarm for the last third of the night; if you wake, pray two or more rakats. You get the reward of both.
For the method see how to pray tahajjud, for tonight's times see tahajjud time, and for the difference between the terms see qiyam al-layl and tahajjud.
The evidence
Quran, Surah As-Sajda 32:16
تَتَجَافَىٰ جُنُوبُهُمْ عَنِ ٱلْمَضَاجِعِ يَدْعُونَ رَبَّهُمْ خَوْفًۭا وَطَمَعًۭا وَمِمَّا رَزَقْنَٰهُمْ يُنفِقُونَ ﴿١٦﴾
They arise from [their] beds; they supplicate their Lord in fear and aspiration, and from what We have provided them, they spend.
Praises rising from sleep to pray, the root meaning of tahajjud.
Quran, Surah Al-Israa 17:79
وَمِنَ ٱلَّيْلِ فَتَهَجَّدْ بِهِۦ نَافِلَةًۭ لَّكَ عَسَىٰٓ أَن يَبْعَثَكَ رَبُّكَ مَقَامًۭا مَّحْمُودًۭا ﴿٧٩﴾
And from [part of] the night, pray with it as additional [worship] for you; it is expected that your Lord will resurrect you to a praised station.
The command of night prayer as extra worship.
Sahih Muslim 755
Sahih... من خاف أن لا يقوم من آخر الليل فليوتر أوله ...
"Whoever fears he will not get up at the end of the night, let him pray witr at its beginning."
Praying witr before sleep is the right choice when waking is uncertain.
Jami' at-Tirmidhi 470
Grading to be checked... لا وتران في ليلة ...
"There are no two witrs in one night."
If you prayed witr before sleeping, you do not repeat it after tahajjud.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, chapter on witr and nawafil. Tahajjud is properly after sleep, while nafl after Isha before sleeping counts as night prayer.
- al-Hidaya, Kitab al-Salah, chapter on witr. Delaying witr to the end of the night is recommended for one who trusts himself to wake.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.