There are many previous studies on designing efficient and high-order numerical methods for stochastic differential equations (SDEs) driven by Gaussian random variables. They mostly focus on proposing numerical methods for SDEs with independent Gaussian random variables and rarely solving SDEs driven by dependent Gaussian random variables. In this paper, we propose a Galerkin spectral method for solving SDEs with dependent Gaussian random variables. Our main techniques are as follows: (1) We design a mapping transformation between multivariate Gaussian random variables and independent Gaussian random variables based on the covariance matrix of multivariate Gaussian random variables. (2) First, we assume the unknown function in the SDE has the generalized polynomial chaos expansion and convert it to be driven by independent Gaussian random variables by the mapping transformation; second, we implement the stochastic Galerkin spectral method for the SDE in the Gaussian measure space; and third, we obtain deterministic differential equations for the coefficients of the expansion. (3) We employ a spectral method solving the deterministic differential equations numerically. We apply the newly proposed numerical method to solve the one-dimensional and two-dimensional stochastic Poisson equations and one-dimensional and two-dimensional stochastic heat equations, respectively. All the presented stochastic equations are driven by two Gaussian random variables, and they are dependent and have multivariate normal distribution of their joint probability density.