From: Rabbi Moshe Sofer
To: Rabbi Yechezkel Segal
The Chasam Sofer rules that an adam chashuv summoned to testify in a non-Jewish court should go and testify, particularly where his word is known to be credible. If his testimony causes the defendant to incur penalties beyond what is actually owed, the witness must compensate the difference under the principle of matzil atzmo b'mammon chaveiro. Where refusal would cause a certain chillul Hashem, leniency is warranted even according to the stricter authorities.
Source: Shu"t Chasam Sofer CM §23