Most probably after the 3rd War. It seemed like Orochimaru was already a rogue ninja when he took in Kimimaro. Also, Kimimaro is supposed to have died in his teens. So that would place the extinction of the Kaguya clan after the 3rd War. Note also the fact that Haku was already around 9-10 years old when Zabuza+Haku (who were fleeing Kirigakure) bumped into Orochimaru and Kimimaro. And Haku also died in his teens while defending Zabuza. So that means that the event in question took place after the 3rd War.