John D. Gregg was born around 1830 in Pennsylvania. He married Susan Husten on December 4, 1854, and their son Milford was born on April 29, 1856. They lived in Philadelphia, Pennsylvania, and Gregg worked as a policeman. By 1860, he owned $200 of personal property.
He enlisted in the Union army on August 28, 1862, and he mustered in as a sergeant in Company G of the 11th Pennsylvania Infantry. The regiment took part in the Second Battle of Bull Run, the Battle of Antietam, the Battle of Fredericksburg, the Battle of Chancellorsville, the Battle of Gettysburg, the Overland Campaign, the siege of Petersburg, and the Appomattox campaign. He was wounded at Fredericksburg on December 13, 1862, but he eventually recovered and rejoined the regiment. He received a gunshot wound to the abdomen in the Battle of Five Forks on April 1, 1865, and he died later that day.