He was educated at the Collège de Sainte-Anne-de-la-Pocatière and was licensed as a notary in 1869, setting up practice at Rivière-Ouelle and later at Quebec City.
Gagnon also served as secretary-treasurer for the municipality and for the school board.
Gagnon married Marie-Malvina Gagnon in 1870.
He helped found the Quebec City newspaper L'Électeur in 1880.