The true question is why are you trying to focus on 2 races in the same weekend? I have done it before so it is possible.
The #1 thing you need to do is to try to recover your body as much as you can immediately after the 10 miler. Within 30 minutes of finishing you need to get good carbohydrates and proteins in (banana, bagels, fruits) and recovery drink if you do that. If you want the best results for the day after I would tell you to go home and soak in an ice bath for about 15 minutes(yes an ice bath). This will help to speed recovery in your legs and limit muscle damage on your legs after the 10 miler.
The evening before the 5k I would say to eat something high in omega 3 fatty acids (fish, salmon etc) to help reduce soreness in your legs.
Now on to how to properly speed train for both the 10 miler and the 5k. I would actually tell one of my athletes to focus more on the 10 miler and the speed work for that race 5 or 6 mile interval workouts etc because this will show you better results on the shorter distance event. If you are training at threshold or near threshold for the long distance, going the shorter distance will be easier.
Example of a good longer speed workout helping both is a 6 mile run broken down 2 miles easy, 3 miles @ short tempo pace 15 seconds per mile above 5k pace (uncomfortable but not unbearable) and 1 mile easy to cool down. Another option 2 mile easy 800meter repeats on 1 minute rest for 3 mile, 1 mile mid tempo pace 10k pace and 2 miles easy
Hope that helps, good luck