Just get the gasket
. FYI, the gasket is rather thick and rigid plastic... not the typical rubber gasket you're thinking of. Getting the upper box back together with the gasket is a PITA but doable (its not designed to be opened if there is no filter in there). Make sure you reset the ECU after you get it right (my advice is to unplug the battery before you start the procedure). Check out www.fandsauto.com
they are Subaru junk yards. Any non-California or early 99 cal-spec Impreza, Forrester, or Legacy will have the same 2nd airbox and gasket.
edited link for Octagon Spares