That is one way of doing it, just make sure you get it deep enough, say not less than 20mm
An alternative might be to foam it and rake out only a little say 6mm and use a coloured sealant. The sealant can be tooled to look neat. With silicone sealants you need to keep your tool wet all the time...