score:1
If it's with the same airline or the same alliance, your luggage will go all the way to Tokyo. The number of hours in transit doesn't really matter. In MΓ‘laga, at check-in, the employee will ask you where you're going, and whether you want to check your luggage to your final destination. Say yes, and you can pick up your luggage in Narita.
Upvote:4
You will have to ask your airline about this on this specific itinerary. With 8 hours, probably not, unless it's overnight.
I have had to collect luggage on an overnight connection ~8 hrs before so...