During development of the central nervous system, synaptic connections are excessively generated and reduced gradually via selective synaptic pruning. However, the rule for the selective pruning remains incompletely known. The candidate mechanisms include the Hebb’s rule, which predicts that synaptic connections between neurons that fire synchronously survive developmental pruning. To experimentally verify this well-known theory, we induced synchronous firing in layer 2/3 neurons of the mouse somatosensory cortex that sparsely expressed ChR2 through in utero electroporation. We transcranially stimulated ChR2-positive neurons on postnatal day 9-to-13 and investigated synaptic connectivity using in vitro patch-clamp recordings from multiple layer 2/3 pyramidal neurons. The neocortex that received chronic photostimulation exhibited higher probabilities of synaptic connections between ChR2-positive neurons, compared to non-stimulated neocortex. The results are consistent with the Hebb’s rule.