National security letters can compel the production of some kinds of (non-"content") user data, and (according to Wikipedia) typically contain a nondisclosure requirement forbidding the recipient of the letter from disclosing it. I assume that a witness has received and complied with a national security letter, and a non-government party wants to ask the witness questions which outside the courtroom, the witness would be forbidden to answer by the national security letter.
The witness, or the government if represented in the lawsuit in question, may object to the questions. The purpose which justifies the secrecy requirements of a national security letter is also likely to justify the exercise of state secrets privilege. If the judge thinks a statute might otherwise be violated, they might intervene in the absence of any objection, or consider alternative remedies like an in camera hearing.
If the court does not intervene to prevent the evidence being given, and the witness is charged with breaching the secrecy law, this would raise complex questions about the interpretation of the law imposing criminal penalties. The common law doctrine of absolute privilege for witnesses giving evidence in judicial proceedings applies in the United States, and could be raised in defence to any criminal charges.