I dont see why not...Kratom doesn't really cause significant respiratory depression, especially if you took a stimulant-level dose, as it sounds.
Also, 5 mg is a pretty small dose of Ambien. I'm sure you will be just fine combining the two, though I can't vouch for what will happen if the Ambien does't make you fall asleep (might be a a little trippy, but not dangerous certainly).