You will need to create a script that you attach to the panel that enumerates and stores all of its children's instanceID, as well as the panel's own. I recommend using a hashtable or dictionary for storage, so it's fast. Then, your panel script that checks to see if the mouse is still hovering simply needs to check if the currently hovered target instanceID is the panel itself or one of those children. If so, do nothing. If not, close the panel. I also recommend adding a small window of opportunity for the mouse to re-hover the window, as sometimes the user will not be accurate and the mouse will stray off the window for a fraction of a second.
I wrote a fairly general panel manager with this type of functionality for my own project, which you will want to do as well... so you can easily add it to any panel you create that you want to behave in this fashion.