Depends on who that third party airline is, and what lounge.
If it's a QF SG accessing a oneworld (non-QF) lounge (eg. CX) flying another oneworld carrier (eg. MH), then MH pays as they are the operating carrier.
I'm unsure what happens in cases where a oneworld carrier has chosen to use a non-oneworld lounge (third party contract lounge) eg. AA in HKG uses Plaza Premium. Example: if you're flying CX and try and access the Plaza Premium with QF SG status, based on the fact AA uses that lounge.
A notable exception in this case is the Dnata Skyview lounge at SIN that CX uses... they let you in regardless which oneworld carrier you're flying, despite it being a contract lounge...
In *A if using elite status to access a lounge, the elite's FFP carrier pays. If it's based on CoS then the operating carrier pays.
Plating carrier doesn't seem to come into play at all.
Disclaimer: this info is extrapolated from numerous conversations I've had with lounge staff, across multiple airline lounges.