It is legal but the jurisdiction of the country you will be renting the site is the issue and also you must prove what kind of activity you will conducting because it is risky for the owner if you put bad activity in their license .
Even if it's possible to rent license even if it is illegal to base on some replies here in this thread as it is against the tos but what if the owner of the license let op rented it but later on then the owner will take back (by reporting that it is stolen/illegal acquiring of the license) or voided the agreement they made in renting the license then op will be force to use his/her own lincense (which should have been the first choice) or run his/her own gambling site without license.
^ I did not hear that, I don't know if renting is applicable to sold or change on the other hand.
If I were on OP, I will purchase my own license that renting this and that is right, it is very risky at all to rent and it could be questionable to the country regulatory if the name of the license is irrelevant to the running gambling brand.
However, I have heard Malta is the cheapest place to buy a license, you can read this article on how to get a license in the online gambling business.
https://slotegrator.pro/analytical_articles/how-to-get-an-online-gambling-license-in-malta.html