The results of my searching for William Berry do not suggest that he participated in the American Civil War; or alternatively for a very short time.
The American Civil War covered the period 1861 to 1865.
You have him arriving in New Zealand in 1864.
William and Henrietta are confirmed as being in Edinburgh for the 1861 UK Census, held for "the night of 7 April 1861"-
Household Members First name(s) Last name Relationship Marital status Gender Age Birth year Occupation Birth place William Berry Head Married Male 26 1835 Printer St Stephens, Midlothian, Scotland Transcription Henrietta Berry Wife Married Female 24 1837 - Haddingtonshire (East Lothian), Scotland Transcription Mary Stuart Visitor Unmarried Female 22 1839 No Occupation England Transcription Print individual transcription Individual transcription First name(s) William Last name Berry Relationship Head Marital status Married Gender Male Age 26 Birth year 1835 Occupation Printer Birth town St Stephens Birth town as transcribed ST STEPHENS Birth county Midlothian Birth county as transcribed MIDLOTHIAN Birth place (other) Scotland Birth place other as transcribed - House name West Dick Place Roseberry Cottage Street - Parish St Cuthbert's City or borough - County Midlothian Country Scotland Municipal ward - Parliamentary borough - Registration district Newington Enumeration district 79 Piece number - Folio number - Page number - Family member last name BERRY, STUART Family member first name(s) HENRIETTA, WILLIAM, MARY Record set 1861 England, Wales & Scotland Census Category Census, land & surveys Record collection Census Collections from Great Britain (c) brightsolid online publishing ltd
On the LDS Family Search site, from his Marriage in 1860, there are two children recorded, born in 1861 and in 1863, both in Edinburgh-
William Berry Scotland, Births and Baptisms, 1564-1950 birth: 9 April 1861 EDINBURGH PARISH,EDINBURGH,MIDLOTHIAN,SCOTLAND father: William Berry mother: Henrietta Younger
David Garden Berry Scotland, Births and Baptisms, 1564-1950 birth: 15 January 1863 EDINBURGH PARISH,EDINBURGH,MIDLOTHIAN,SCOTLAND father: William Berry mother: Henrietta Younger
Scotland's People accessing the "Genera Registry of Scotland" appears to confirm the 1861 Birth and the 1863 Birth, without looking at the details on the Scanned IMAGE.
Back on the LDS FS site, there are three New Zealand Births attributed to the couple, of which the earliest is-
Sarah Thomsen /Berry/ birth: 1 November 1865 Auckland, New Zealand death: 20 June 1946 Takapuna, New Zealand less More information
spouse: Living death: William /Berry/ birth: 1835 Midlothian County, Scotland death: 2 October 1903 Takapuna, New Zealand Henrietta /Younger/ birth: 22 May 1835 East Lothian, Scotland death: 9 January 1918 Takapuna, New Zealand
Those two Scottish Births of 1861 and 1863 and the first New Zealand Birth of 1865, leave very little time for William to have been much involved in the American Civil War, especially the travelling time involved etc.
This suggests that you may be pursuing the wrong line.