The first point will be that once you move the mouse over the button and a lightbox appears with the onMouseIn event handler function, think about how a lightbox appears and works on your page…
The lightbox will appear with an overlay around it and the user will not be able to access the button again on your page to activate the button again to close the lightbox with the onMouseOut event handler function.
So you would be easier making the buttons on your page to simply open the lightbox by onClick - onMouseIn will only work on desktop devices, it won’t work on mobile devices.
Then simply use the lightboxes own close and/or x button, as well the option of clicking on the overlay, to be able to close the lightbox.
You can use code to close the lightbox instead with your own button, however to do this you need to remove the lightboxes own close and x buttons.