I was swapping out the stock stem to try a one with a different length. When I removed the cap I noticed a gap between the top of the steerer and the top of stem collar (see pic). Is this gap normal?
That is normal. Generally, as long as the steerer tube reaches above the top bolt on your stem, it is safe to run it this way. Just throw the top cap on and you are good to go!
The gap is not only normal, it is actually completely necessary for your headset to work properly. Without the gap, the top cap would not have any space to ‘compress’ the headset assemble (including the stem and any spacers). As Ian touched upon, you want the majority of the stem to be clamping the steerer though (yours is), but this is why often you would have a small headset spacer above the stem as well as below. So do not worry, you’re all good!
Thanks nico_synergy. Looking at my original post I realize I should have been more clear with my question. As you said the gap is needed, but what I was wondering if it was ok to have gap within the stem collar. Regardless you guys answered my question!