How to securely attach a wooden plank to a wooden banister
Use screws


The baby gate will tear the banister up so you need something to protect it. A 2x4 is a good solution
Screws come out easily and leave small holes. 2 screws total (I'd suggest 3" myself) should do the trick. Wood putty the holes and stain and/or lacquer


One tip: put something like a piece of plastic (maybe a plastic bag) between the banister and the 2x4. The lacquer finish (or paint) might get damaged by being sucked up to the 2x4