Trichoderma harzianum is a well-known biological control agent (BCA) that is effective against a variety of plant pathogens. In previous studies, we found that T. harzianum T4 could effectively control the gray mold in tomatoes caused by Botrytis cinerea. However, the research on its biocontrol mechanism is not comprehensive, particularly regarding the mechanism of mycoparasitism. In this study, in order to further investigate the mycoparasitism mechanism of T. harzianum T4, transcriptomic sequencing and real-time fluorescence quantitative PCR (RT-qPCR) were used to identify the differentially expressed genes (DEGs) of T. harzianum T4 at 12, 24, 48 and 72 h of growth in the cell wall of B. cinerea (BCCW) or a sucrose medium. A total of 2871 DEGs and 2148 novel genes were detected using transcriptome sequencing. Through GO and KEGG enrichment analysis, we identified genes associated with mycoparasitism at specific time periods, such as encoding kinases, signal transduction proteins, carbohydrate active enzymes, hydrolytic enzymes, transporters, antioxidant enzymes, secondary metabolite synthesis, resistance proteins, detoxification genes and genes associated with extended hyphal longevity. To validate the transcriptome data, RT-qCPR was performed on the transcriptome samples. The RT-qPCR results show that the expression trend of the genes was consistent with the RNA-Seq data. In order to validate the screened genes associated with mycoparasitism, we performed a dual-culture antagonism test on T. harzianum and B. cinerea. The results of the dual-culture RT-qPCR showed that 15 of the 24 genes were upregulated during and after contact between T. harzianum T4 and B. cinerea (the same as BCCW), which further confirmed that these genes were involved in the mycoparasitism of T. harzianum T4. In conclusion, the transcriptome data provided in this study will not only improve the annotation information of gene models in T. harzianum T4 genome, but also provide important transcriptome information regarding the process of mycoparasitism at specific time periods, which can help us to further understand the mechanism of mycoparasitism, thus providing a potential molecular target for T. harzianum T4 as a biological control agent.