Well all I can say is I don't think it is in the Pali Canon and I certainly think its the first I've come across it*, it sounds similar to the birth of Indra and as I pointed out various other myths.
*I make it a point to avoid the Buddha myths, cosmology and other fantastical stuff surrounding the life of the Buddha. I'm tempted to suggest that comes from something like the Lalitavistara Sūtra or another Mahayana text which lend themselves to amazing stories and whatnot. These are 1st-3rd CE texts and well its up to others if they want to engage in that area of Buddhism and not for me to pass judgement I'm just not sure what is to be gained there. I should also point out that I am somewhat alienated and I think most westerners can't even imagine the level of syncretic practice around beliefs in the Eastern part of the world during that time.