Understanding the response of the injured brain to different transcranial direct current stimulation (tDCS) montages may help explain the variable tDCS treatment results on poststroke motor gains. Cortical connectivity has been found to reflect poststroke motor gains and cortical plasticity, but the changes in connectivity following tDCS remain unknown. We aimed to investigate the relationship between tDCS-induced changes in cortical connectivity and poststroke motor gains. In this study, participants were assigned to receive four tDCS montages (anodal, cathodal, bilateral, and sham) over the primary motor cortex (M1) according to a single-blind, randomized, crossover design. Electroencephalography (EEG) and Jebsen-Taylor hand function test (JTT) were performed before and after the intervention. Motor cortical connectivity was measured using beta-band coherence with the ipsilesional and contralesional M1 as seed regions. Motor gain was evaluated based on the JTT completion time. We examined the relationship between baseline connectivity and clinical characteristics and that between changes in connectivity and motor gains after different tDCS montages. Baseline functional connectivity, motor impairment, and poststroke duration were correlated. High ipsilesional M1–frontal–temporal connectivity was correlated with a good baseline motor status, and increased connectivity was accompanied by good functional improvement following anodal tDCS treatment. Low contralesional M1–frontal-central connectivity was correlated with a good baseline motor status, and decreased connectivity was accompanied by good functional improvement following cathodal tDCS treatment. In conclusion, EEG-based motor cortical connectivity was correlated with stroke characteristics, including motor impairment and poststroke duration, and motor gains induced by anodal and cathodal tDCS.