Yes, you can. BUT - you will have to get a 'certificate of recognition' from the Spanish authorities. To this end you will need:
- a copy of your log book certified by public notary
- a copy of your license and medical certified by pubilc notary
- various forms
- patience: it takes anything from 2-6 weeks
The way to proceed is:
- find a place where you want to rent from, e.g. Aerodynamics in Malaga
- contact them
- send them the above docs
- hope your cert arrives in time
Thereafter, flying in Spain is great
PS: your post doesn't state which license you hold, I am assuming FAA. Should it be a national European (especially German or Austrian), there are a few other options, as some FTO/FBOs have D-reg a/c