Analog 3-state buffer where the input voltage equals the output voltage and is controlled by a digital control line
Why not just drive a 5V square wave to the pot?

However your LED circuit likely wont do what you expect - LED brightness is not linear with current (or voltage) - the best way to dim a flashing led is by gating a PWM signal on and off