Since you will arrive and depart at terminal 1, best to store your luggage there as there's no storage facility at terminal 5. You can take AirTrain between terminals; track 2 is the terminal-only loop between T8 and T1 in descending order (T8>T1), track 1 stops at terminals in ascending order (T1>T8) and continues ffrom T8 to rental cars, long term parking and public transportation. So when you arrive at T1 take track 1 to T5, going back take track 2 from T5 to T1.
Since you will arrive and