One can't really tell from cursory observation just when the Doctor became sentient. I tend to think that the potential was always there, but most EMHs weren't meant to be kept in continuous use, so they weren't given the opportunity for the necessary complexity to grow in their neural networks. And the unusual challenges the EMH faced aboard Voyager may have forced his software to drive itself to a higher level of operation in order to cope with them; and Kes's encouragement of his development probably helped as well. But I don't think a specific moment of "awakening" can be pinpointed; it was probably more a gradual emergence of complexity, like an infant growing into a child, only faster.
Just out of curiosity, at what point is a human child considered to be truly sapient? You've discussed before the fact that dogs might be at four-year old level, which surprised me (and caused me, actually, to rethink my attitude toward them), and I recall you posting an interesting link to a discussion of sapience or its potential in octopus, in spite of their short lives. So is there a consensus or majority position on when a human makes the transition from sapience-in-potential to true sapience, if such a determination can even be made?