Current goes from +5 to the LED to the resistor to the pin to 0volts. Therefore you have a complete path for current flow.