Your nail gun’s safety mechanism may not allow you to nail where you want and at the angle you want. That said, this is a case of the right tool for the job. A Dewalt 51275 is not the right tool for this job – a floor stapler like the Bostitch Mark III FS is. They are available from rental stores (Home Depot, DIY, Nations Rent, Lowes, etc). It uses a 2 inch long 1/2″ wide 15 gauge staple.
Your gun – is great for light work and trim, but not installing hardwood flooring.