WARNING: This page is about a different car, the 2006 Subaru Outback and 2006 Subaru Legacy. However, it is still accessible from the selected car via links, so may be relevant.
Measure the resistance between trunk lid switch terminals.
Fig 1: Identifying Trunk Lid Switch Connector Terminals