Anti-inflammatories like ibuoprofen shouldn't be taken while exercising, since they can damage your kidneys. It's acetaminophen or nothing.
And anything like that is going to be a bad idea. If you're encountering pain, it's for a reason. Things that mask the pain are just going to lead to you doing more damage to yourself without realizing it until later, and you'll make it even worse than it would be otherwise in the process.
If it's setting in within 5km of running, you're still going to encounter it walking over a marathon. And any limping, etc. you start to do is going to lead to more problems elsewhere.
You also haven't trained to walk a marathon. Walking a marathon is a different experience rather than just the "easy way through." You're doing more repetitions over a much longer period of time, and you're going to encounter issues like dehydration, sunstroke, chafing, etc. that you have't prepared for. The "easy" way through a marathon is actually a run-walk, which you're assumably not going to be up for.
If it's just two days away, I'd strongly suggest reconsidering participating at all. I know IT stuff can be a major pain, but if you push it with even attempting a walk, you're very likely to do even more damage to yourself over the long run.