Its possible with Mathew since he was one of the 12 who didn’t fall asleep.
Peter, James, John were the ones that fell asleep.
After Jesus ascended into heaven, the 12 and others probably mulled over lots of things Jesus said and did among themselves. Jesus himself had 40 days after his resurrection to spend with them and some of these things may have come out during that time as well. One incident is when he travelled with 2 of them on the road to Emmaus, when he explained the scriptures to them. He may have explained other things as well. He may have done this numeous times with them because we don’t have everything he did written down.
Just some thoughts.