Repeat Command block not sending out a red stone signal

Solution 1:

You are checking if the nearest player is exactly 5 blocks away, to check if the nearest player is up to 5 blocks away you can use:

/execute if entity @p[distance=..5]