Translation:He treats me as if I were a stranger.
I think you misunderstood what Duolingo was correcting. As an English native I would say "He treats me like I were a stranger" or "He treats me as if I were a stranger". I don't know the rule for it, but using like and if together in this context sounds strange to my ear.
Sidenote: In colloquial English it's common to say "I WAS a stranger", it was only through these lessons that I learned that "I WERE" is the formal way of writing this in English subjunctive.
One question about the possibility of ellipsis of the pronoun in the subject of the subordinate clause
I tried "ele me trata como se fosse um estranho" and got rejected. I know that “fosse” may be both 1st and 3rd person of the singular, buy there is little room, if any, for ambiguity, so based on what I learned it should be OK not to include the pronoun ”eu“.
Does Portuguese work differently than Spanish in this sort of sentences? (The Spanish translation is completely equivalent, even in the sameness of the conjugation of the verb for 1st and 3rd person singular, and the omission of the pronoun is admitted and even encouraged. In fact, to include the subject would serve to provide emphasis.)