For Sneak Attack, what if another enemy of your target was 10 feet away with a polearm (which has a reach of 10 feet), instead of 5 feet away? Would you still be able to use Sneak Attack?

The 5-foot limitation in Sneak Attack is unaffected by the reach of a weapon. That other enemy of the target is creating a close-up distraction, regardless of the weapon in hand.