Hold a wood shim in front of the gap where the banister enters the newel post. Mark the gap's width onto the shim with a utility knife. Set the shim on a flat surface and rip it to fit in the gap, using the utility knife.
Apply a bead of wood glue to both sides of a wood shim's thin end. Insert the shim into the gap. Tap the shim's thick end lightly with a hammer to push it in a bit further, but don't force it.
Cut the portion of the wood shim extending out of the gap off with a utility knife. Use multiple shallow cuts to avoid cutting the banister.
Repeat the steps with a second shim if the first wood shim didn't extend far enough in to fill the gap. Lightly sand the back of the wood shims with a sanding sponge to help blend them into the newel post.
Apply wood putty over the back of the wood shims using a 1 1/2-inch putty knife. Force the putty into any spaces between the shims and the newel post. Allow the putty to dry according to the manufacturer's directions. Sand the putty smooth with a sanding sponge and paint or stain it to match the newel post.