An imbalance of excitatory and inhibitory synaptic transmission in multiple sclerosis (MS) may lead to cognitive impairment, such as impaired working memory. The 1/f slope of electroencephalography/magnetoencephalography (EEG/MEG) power spectra is shown to be a non-invasive proxy of excitation/inhibition balance. A flatter slope is associated with higher excitation/lower inhibition. To assess the 1/f slope modulation induced by stimulus and its association with behavioral and cognitive measures. We analyzed MEG recordings of 38 healthy controls (HCs) and 79 people with multiple sclerosis (pwMS) while performing an n-back task including target and distractor stimuli. Target trials require an answer, while distractor trials do not. We computed the 1/f spectral slope through the fitting oscillations and one over f (FOOOF) algorithm within the time windows 1 second before and after each stimulus presentation. We observed a flatter 1/f slope after distractor stimuli in pwMS compared to HCs. The 1/f slope was significantly steeper after stimulus for both HCs and pwMS and was significantly correlated with reaction times. This modulation in 1/f slope was significantly correlated with visuospatial memory assessed by the BVMT-R test. Our results suggest possible inhibitory mechanism deficits in pwMS during a working memory task.