Ive seen people use fishing line to type it, Glue it, Silicone it. Sky's really the limit as long as it isn't toxic. You could also use rocks to sit on the edge of it at the waterline.
Short answer, Siliconing it there would.
I don't have your mental vision of how it all will look, but I am assuming you want it to hide the egg crate as well as filter the water that flows under the crate?