Throwing the term ergative and Ergativ on Google book search I find a salient citation from 1894 in Zeitschrift für Völkerkunde
von den Kasus unterscheidet Taplin in den südaustralischen Sprachen außer den sechs bekannten noch einen Exativ und Ergativ
Some earlier findings like Ergativ elektrisch werdende are scanning errors (in this case ignorance of two-column layout).
The mentioned Taplin is George Taplin and – although the language he described has actually an ergative – he used this term for a case that may be nowadays named comitative ("with") or the related case proprietive ("having"). Etymologically, the term was probably derived from Latin erga "towards, against (in a friendly sense)".
The term ergative was picked up by the German linguist Wilhelm Schmidt in 1902 in a work on languages in Papua-Newguinea and reinterpreted by associating it with the Greek word ergon "work" and given its modern interpretation.
This account is based on Blake 2016, p. 138 who writes:
Faced with the unfamiliar ergative case, Meyer used ‘ablative’ in Ngarrindjeri, presumably inﬂuenced by the use of the ablative to mark the agent of the passive in Latin. Taplin (1872), writing about the same language, also used ‘ablative’, but used ‘causative’ with pronouns. This use of the ablative left him in need of a label for the case expressing ‘from’ so he invented the label ‘exative’. He also invented the term ‘ergative’ for a local case glossed as ‘with’. This appears to have been based on Latin ergā ‘towards, in respect of, in relation to’. He abandoned it in his later work, but not before it had been taken up by others including Hagenauer and Bulmer. 13 This would not have been a problem,
but the term was then reinterpreted by Schmidt (1902: 88) as the case for the agent of a transitive verb, presumably by associating it with the Greek root erg as in ergon ‘work’ (Manaster-Ramer 1994; Lindner 2014).
The reference for Schmidt 1902 is:
Schmidt, Wilhelm. 1902. Die sprachliche Verhältnisse von Deutsch Neu-Guinea [Part 2]. Zeitschrift für afrikanische, ozeanische und ostasiatische Sprachen 6, 1-99.