When on a codeshare, it's the operating airlines rules that apply. The marketing airline is irrelevent.
Some operating airlines further differentiate with one set of lounge access rules for those that bought from the operating airline itself, and a (worse) set of rules for those that purchased the codeshare flight from a different airline.