Reading both Matthew and Luke we should observe three things: (see a scripture parallel in our ITW Synopsis of the Angelic Announcements).
1) They both account for an occasion where Jesus' divine conception was made known to a person.
2) We should readily acknowledge that the "person" was not Matthew or Luke, but rather Joseph (according to Matthew) and Mary (according to Luke).
3) The two authors write different accounts and identify two separate persons (Joseph/Mary) who received similar revelation (in somewhat different ways) that Jesus' conception was divine.
Upon those observations, we may at least suspect that both authors had to either:
a) Interview Joseph (in Matthew's case), or Mary (in Luke's case).
b) Rely on the report of others, or some tradition, built upon the testimony of Joseph and/or Mary.
c) Receive divine revelation from God that this was true.
d) Make up a story.
If option "d" is correct we are still left wondering how the writers of Matthew and Luke came to the knowledge of this story; after all, they appear to not be using each other as sources at this location. If option "c" is correct it by no means rules out options "a" and "b." In that regard, there would be no noticeable features in the text that would highlight "c" over "a" and "b." Therefore, both "a" and "b" may be reasonable options. On the one hand, Luke's disclosure of reporting "handed down" information (Lk. 1:2) may add more weight to "b". On the other hand, he did not state exactly who handed which parts to him, or how many persons were between himself and the "eyewitnesses". Thus, even "a" is a possibility in this case. None of this is to say that God didn't have a hand in providing this information to Matthew and Luke, but revelation had already been provided to others, and their testimony was provided to the authors.
According to some scholars, information of the virgin conception was already in circulation before either Matthew or Luke conveyed their narrative of it: by way of units of oral information emerging from independent communities (i.e. "Form Criticism"). For those Christians who lived prior to Matthew and Luke's reporting, Jesus' divine conception was the overall testimony (as opposed to a natural conception) concerning His birth; and we can be reasonably comfortable believing that both Matthew and Luke accurately portrayed the information available to them.