Yes you can do it in 5 days, for Udaipur read my detailed post about udaipur in 2 days. while in udaipur if you opt for local sight seeing vehicle, don;t visit all those gardens they wanna show you that will save you ample time to visit Sajjangarh Monsoon Palace, Safari park. Kumbalgarh fort in outskirts of udaipur.
https://www.tripoto.com/trip/udaipur-diaries-1-the-city-of-lakes-5df8c646b3413https://www.tripoto.com/trip/udaipur-diaries-continues-2-the-city-of-lakes-5df8cccc77df4
you can leave for jaisalmer by late evening bus so that you can reach jaisalmer early next morning.
In Jaisalmer on Day 1 visit Sonar Killa, Patwon ki haveli etc within city, after lunch start for Sand Dunes , if you wish to stay there in desert safari get the life time experience ( although as it's year end time it will be little costly). Else get back to city in night on day 2 visit to Langewala , Tanot Mata Temple and get back to jaisalmer in evening. in night start return journey to your home town.