(B) in the case of an officer or employee of the District of Columbia, only with respect to communications to or appearances before any officer or employee of any department, agency, or court of the District of Columbia on behalf of any other person (except the District of Columbia), and only with respect to a matter in which the District of Columbia is a party or has a direct and substantial inte