For galling aphids and their hosts, tannins are crucial for plant-insect interactions and for protecting the host plant from herbivory. Due to their peculiar chemical characteristics, tannins from plant galls have been used for medical and chemical purposes for more than 2000 years. In this study, hydrolyzable tannin concentrations in galls increased from gall initiation (38.34% on June 21) to maturation (74.79% on August 8), then decreased gradually thereafter (58.83% on October 12). We identified a total of 81 genes (named as GTS1-81) with putative roles in gallotannin biosynthesis and 22 genes (TS1-22) in condensed tannin biosynthesis. We determined the expression profiles of these genes by real-time PCR over the course of gall development. Multiple genes encoding 1-beta-D-glucosyl transferases were identified, which may play a vital role in gallotannin accumulation in plant galls. This study is the first attempt to examine the molecular basis for the regulation of tannin accumulation in insect gallnuts. The differentially expressed genes we identified may play important roles in both tannin biosynthesis and plant-insect interactions.