We study the role of coronal mass ejection (CME) driven shocks in the acceleration of solar energetic electrons. Using observations by the two STEREO spacecraft, we correlate electron peak intensities of solar energetic particle events measured in situ with various parameters of the associated coronal shocks. These shock parameters were derived by combining 3D shock reconstructions with global modeling of the corona. This modeling technique provides also shock properties in the specific shock regions that are magnetically connected to the two STEREO spacecraft. We find significant correlations between the peak intensities and the Mach number of the shock with correlation coefficients of about 0.7, which are similar for electrons at ∼1 MeV and protons at >60 MeV. Lower-energy electrons with <100 keV show a smaller correlation coefficient of 0.47. The causal relationship between electron intensities and the shock properties is supported by the vanishing correlations when peak intensities at STEREO A are related with the Alfvénic Mach number at the magnetic footpoint of STEREO B and vice versa, which yields correlation coefficients of 0.03 and −0.13 for ∼1 MeV and <100 keV electron peak intensities, respectively. We conclude that the high-energy electrons are accelerated mainly by the shock, while the low-energy electrons are likely produced by a mixture of flare and shock-related acceleration processes.