Born in 1826 in Charlestown, Massachusetts, Dennis was living in Boston when he joined the Navy. He served during the Civil War as a boatswain's mate on the "USS Brooklyn". At the Battle of Mobile Bay on August 5, 1864, he operated the ship's torpedo catcher (an early naval minesweeping device). He helped fire the bow chase gun during heavy fire. Because of this action, he was given the Medal of Honor four months later, on December 31, 1864.