Well, the "Gatling gun" (Invented in Maine) certainly places the lyrics in the original post in the post Civil War Period. Maybe it was an update of an older song to the Spanish American War of 1898. Folk singers do that all the time.
Cheerily,
Charley Noble