Most of the rosters show a John Gains in Company E, 20TH regiment with no middle initial but I don't see a James, At this site it shows a J. T. Gaines in Company E, 20th Regiment:
http://ftp.rootsweb.com/pub/usgenweb/ga/military/civilwar/gsi/gsi106.txt