Flying internationally, it is F at point of departure or point of connection that counts.
Otherwise, i could fly HKG-(TG)-BKK-(SQ)-SIN-(LH)-FRA-(UA)-EWR, with HKG-BKK in F, then BKK-SIN-FRA-EWR in economy, and assume to have First class lounge priviledges at both Singapore and Frankfurt.
FYI, the actual carrier pays the lounge owner (i stand corrected on this), so in the case above, i wouldnt expect LH (@SIN) and UA (@FRA) to pay for first class lounge access just because you took a leg in first class.....makes sense?