I did mine after 6 weeks of no training. I ran as much as I could (which was about half of it as I just wasn't fit enough to do more) and I'm very glad I did.
On the downside, I then spent the best part of the next 2 weeks unable to walk without a lot of pain. My foot got better much more quickly than before, though, and it's back to a stage where I'm ready to start running again, albeit only a tiny bit at a time.
When I asked my doctor (a runner himself, so he understood where I was coming from), whether I could/should do it, he was understandably reluctant to commit, but when I summed up what I'd understood from him, he agreed. That was "it's only 5k, it's not likely to do any long lasting or permanent damage, but it might well do it no good at all short term and if I decide to do it, I should be prepared to take the consequences". He also said that if I really wanted to do it, I should.
In my case it was hard to judge how far to push things, as I knew that it probably wouldn't hurt while I was doing the race, but I'd find out a couple of days later what, if any, damage I'd done. If, in your case, you'll feel the pain while you're still running, then I'd say go ahead, take it easy, if it's feeling good and you want to, then push yourself a little bit harder, but don't overdo it. Remember that you'll feel a lot better about the whole thing if you walk more early on and still have enough left to run the last few hundred metres, than if you wear yourself out so much that you can only stagger to the end
Really, though, it's a decision only you can take. It's your body, only you can know how it feels and how far you can push it. GPs will always err on the side of caution (I was frankly amazed that mine went as far as he did). If it's important to you to run as much as you can, then do it, but keep your sensible head on and slow down/stop if your body is protesting at you.
Good luck :d