Won't the organization you're fostering for have him neutered? It really should be done asap, as once spraying becomes a habit it may be impossible to break.
I adopted a neighborhood stray when he was a few years old. Had him neutered right away, but 15 years later he's still marking stuff. He's always had to be an outdoor cat because of this.
#FosteringaPet