Paul, I had the same trouble when I first went outdoors. Running in the gym gives you a false sense of security I think! It's totally different to outdoor running, but once I went outdoors, I never ventured back onto the treadmill! When I started, I went out in the car and measured a distance of about a 5 mile circuit, noting the 'markers' of each mile, then I invested in a sports watch and started timing my runs. Even if I beat my last run by a few seconds, I was pleased! Anyway, good luck to you and don't worry about where you finish in a race - maybe enter a few 5k races over a couple of months, then just try and beat your time at each race. Good luck!
Michelle