SQL Server Mirror: Witness Server(s)
Not exactly understand the need, but i guess below might help:

To get the information between Principal and mirror via witness query the dmv sys.database_mirroring_witnesses

You can get the info from columns

principal_server_name -- Name of partner server whose copy of the database is currently the principal database

mirror_server_name  --Name of the partner server whose copy of the database is currently the mirror database.

Also, check out the cool commands from dbatools Get-DbaDbMirror

PS C:\&gt; Get-DbaDbMirror -SqlInstance  sql2016


Gets properties of database mirrors and mirror witnesses on sql2016 SQL Server instance