The Short and the Long of Running Form
Adapting your form to your particular long-distance running event is a smart move. For shorter races such as a 5K, you'll need to take quicker footsteps and have a moderately long stride. Quicker footsteps are a more tiring process but are suited for shorter races. For the marathon, you'll want to conserve more energy, so your back kick should not be too high.
Form drill: Practice this on a treadmill. Put the speed at a comfortable pace, faster than marathon pace but slower than 5K pace and count your footsteps within a one-minute period to give yourself a baseline.
Then, change the speed to both faster than and slower than your baseline to simulate 5K and marathon pace, respectively. Count your footsteps within one minute at these two paces. During your next training run on the road, try to simulate the paces and footsteps of your treadmill run. Notice the mechanics of your form and try to simulate that on race day.