A lean code (and there are multiple codes) does not necessarily mean the intake gasket is leaking.
I am going to assume you did further diagnosis and that gasket is indeed leaking and needs to be replaced.
Using a sealer, you want to use one that is compatible with engine controls. Some of the chemicals in silicone sealer has a bad reaction to sensors. Not recommending Permatex and they have been around for a while. Here is link to FAQ. Click on Optimum Black. You want to see a statement that the sealer is sensor safe.
FAQs – Permatex
Too much sealer is not a good thing either.
Use the Correct Gasket Sealant on Auto Engines Please! - YouTube
And some more if you like to read about stuff.
Tech 101 - How to use the right gasket sealants | Hemmings
And I like using engine oil for paper/cork or fiber gaskets. Metal and rubber gaskets do not get that kind of treatment.
As far as leak prevention for the future. It is all in the surface preparation and the installation. The surfaces have to be absolutely clean and dry. The installation of the manifold has to be squared up to the mating surface. Then torque fasteners in sequence and to the spec. Too many installations the torque is not correct and is not methodical. The shop manual comes in handy here. Without that (I would not do engine work without the shop manual) starting from the center and working the way out to edges in steps is generally what I do when I am lacking direction.
Action