So in Wicked, we know that Elphaba puts a spell on Fyiero so he wouldn't get hurt, making Fyiero turn into the Scarecrow.
While in The Wizard of Oz, Elphaba is literally seen by trying to harm Scarecrow.
And at the end of Wicked, Scarecrow/Fyiero finds Elphaba and they leave Oz together.
This lead me to to 2 things:
Elphaba knows that Scarecrow is Fyiero, and trys to harm him just to see if her spell actually worked. And Scarecrow is scared of Elphaba/ doesn't who Elphaba is, due to not having any brains. So when Scarecrow has his brains back, he remembers Elphaba, and they run away together.
Elphaba knows that Scarecrow is Fyiero this time, but Scarecrow knows who's Elphaba all this time, and tricks everyone into believing that they don't know each other (but they do, and run away together)
So that's my thoughts on Scarecrow and Elphaba during TWoO. But I think number 1 makes more sense.