A particular feature of certain microelectromechanical systems (MEMS) is the appearance of a so-called "pull-in" instability, corresponding to a singularity in the underlying PDE model. We here consider a transient MEMS model and its optimal control via the dielectric properties of the membrane and/or the applied voltage. In contrast to the static case, the control problem suffers from low dimensionality of the control compared to the state and hence requires different techniques for establishing first order optimality conditions. For this purpose, we here use a relaxation approach combined with a localization technique.