This seems most natural to me:
If you knew that yesterday why didn't you tell me [then/at the time/yesterday]?
I'm trying to come up with a sentence using 'wouldn't' but they all feel terribly clumsy. These are about the best I can do:
If you knew yesterday, why would you not have told me?
If you knew yesterday, why wouldn't you have told me?
I suppose if you had asked someone about something the day before, but they said they didn't know, but then revealed that they did know, you could use this:
If you already knew, why wouldn't you tell me yesterday? (when I asked)
but it's still a bit clumsy, and the 'didn't' form still sounds better to my ear
Maybe I'm misunderstanding the question?
Are you saying you think they are lying about knowing yesterday?
You could say this in the third conditional:
If you knew yesterday, you would have told me [already/yesterday]