How to fix this?

Should I use a nail gun first to close up the gap a bit more ( if it even does that) and then caulk it with silicone or gap filler?

Should I use a nail gun first to close up the gap a bit more ( if it even does that) and then caulk it with silicone or gap filler?