Let’s read that incredible event.  Luke 8:40-42 says, “And it came to pass, that, when Jesus was returned, the people gladly received him: for they were all waiting for him. And, behold, there came a man named Jairus, and he was a ruler of the synagogue: and he fell down at Jesus’ feet, and besought him that he would come into his house: For he had one only daughter, about twelve years of age, and she lay a dying. But as he went the people thronged him.”  Along the way, (verses 43-48) the Lord stopped to heal a lady who suffered from an issue of blood for twelve years.  It is important to note that while this woman had literally been dying for twelve years until the Lord restored her health and life, the young girl had been living for twelve years and now faced death.  Indeed, she did die.  We continue reading in Luke 8:49-56, “While he yet spake, there cometh one from the ruler of the synagogue’s house, saying to him, Thy daughter is dead; trouble not the Master. But when Jesus heard it, he answered him, saying, Fear not: believe only, and she shall be made whole. And when he came into the house, he suffered no man to go in, save Peter, and James, and John, and the father and the mother of the maiden. And all wept, and bewailed her: but he said, Weep not; she is not dead, but sleepeth. And they laughed him to scorn, knowing that she was dead. And he put them all out, and took her by the hand, and called, saying, Maid, arise. And her spirit came again, and she arose straightway: and he commanded to give her meat. And her parents were astonished: but he charged them that they should tell no man what was done.”

Peter, James and John formed sort of an ‘inner circle’ of the Lord’s disciples.  These three were with the Lord when He was transfigured in Matthew 17:1-13.  They were also with the Lord during His time of agony in the garden of Gethsemane in Matthew 26:36-46. 

The event of the Lord raising the twelve-year-old girl from the dead is recorded in Matthew (as we have just read), Mark 5:22-42, and Luke 8:41-56.  John, the only one of the Gospel writers who witnessed this gracious miracle did not write about this incident.  You asked how Matthew and Mark knew about this event.  It is obvious that they did not give a firsthand account.  Matthew was a fellow apostle, so it is very possible that Peter, James, and John spoke to them about this miracle.  While the Lord told the little girl’s parents to “tell no man what was done” (Luke 8:56), I do not think this would have prevented the apostles from talking about it among themselves.

We have no record that Mark or Luke ever saw the Lord in His lifetime on earth.  It appears that Mark was later a protege of James as we read in 1 Peter 5:13, “The church that is at Babylon, elected together with you, saluteth you; and so doth Marcus my son.”  They must have been very close for James to consider Mark as his son.  It is quite probable that James taught Mark of the incident. 

Luke wrote the Gospel of Luke and the book of Acts.  In his beginning to his Gospel, he writes, “Inasmuch as many have undertaken to compile an account of the things accomplished among us, just as they were handed down to us by those who from the beginning were eyewitnesses and servants of the word, it seemed fitting for me as well, HAVING INVESTIGATED EVERYTHING CAREFULLY from the beginning, to write it out for you in consecutive order, most excellent Theophilus; so that you may know the exact truth about the things you have been taught.” (Luke 1:1-4) (NASB).

We learn from this that much of the Lord’s life had been “handed down to us by those who from the beginning were eyewitnesses and servants of the word.”  Using the accounts of these eyewitnesses, Luke carefully investigated what he heard and compiled an account of the Lord’s life and actions “IN CONSECUTIVE ORDER.”

It is most important that as we consider how each of these writers got their information so that they could write about the Lord, the Lord Himself inspired each one to write what they did.  2 Timothy 3:16-17 assures us that, “All scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness: That the man of God may be perfect, throughly furnished unto all good works.”  God inspired these men to write, and what to write.  Perhaps they got their information in different ways, but it was the Lord who led them to write the Gospels for us.  (418.6)