Display related entries on a category page filtered by another category field
You'd typically use the group filter for this. Depending on what you need to output, be sure to also use eager loading to improve performance.
{% set groupedEntries = craft.entries.with(['yourOutputCatFieldHandle']).relatedTo(category).all()|group('yourOutputCatFieldHandle[0].title') %}

{% for cat, entries in groupedEntries %}
    &lt;h3&gt;{{ cat }}&lt;/h3&gt;
    &lt;ul&gt;
        {% for entry in entries %}
            &lt;li&gt;&lt;a href=&quot;{{ entry.url }}&quot;&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
{% endfor %}

EDIT: alternative answer below to allow for using the correct category ordering as per the control panel's Structure order.
Note: this approach requires the supersort plugin.
{# ======================================
First, fetch entries related to this category,
then group the array by each category's
`lft` structure position, then sort the array
by those keys with supersort's ksort function
========================================= #}

{% set groupedEntries = craft.entries.with([
        'yourOutputCatFieldHandle'
    ])
    .relatedTo(category)
    .all()|group('yourOutputCatFieldHandle[0].lft')|supersort('ksort')
%}

{# ======================================
Next, create a hash map of those categories so we can
match up the `lft` left structure position
with the category's title later.
(google &quot;Nested Sets&quot; if you're really bored)
========================================= #}

{% if groupedEntries|length %}
    {% set catTitlesMap = craft.categories.group('yourOutputCatGROUPHandle').all()|group('lft') %}
{% endif %}

{# ======================================
Finally, loop through the grouped array,
matching up the accessory's `lft` position
with the hash map to get the right title...
========================================= #}

{% for cat, entries in groupedEntries %}
    &lt;h3&gt;{{ catTitlesMap[cat][0].title }}&lt;/h3&gt;
    &lt;ul&gt;
        {% for entry in entries %}
            &lt;li&gt;&lt;a href=&quot;{{ entry.url }}&quot;&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
{% endfor %}