Revealing the relationship between neural network structure and function is one central theme of neuroscience. In the context of working memory (WM), anatomical data suggested that the topological structure of microcircuits within WM gradient network may differ, and the impact of such structural heterogeneity on WM activity remains unknown. Here, we proposed a spiking neural network model that can replicate the fundamental characteristics of WM: delay-period neural activity involves association cortex but not sensory cortex. First, experimentally observed receptor expression gradient along the WM gradient network is reproduced by our network model. Second, by analyzing the correlation between different local structures and duration of WM activity, we demonstrated that small-worldness, excitation-inhibition balance, and cycle structures play crucial roles in sustaining WM-related activity. To elucidate the relationship between the structure and functionality of neural networks, structural circuit gradients in brain should also be subject to further measurement. Finally, combining anatomical data, we simulated the duration of WM activity across different brain regions, its maintenance relies on the interaction between local and distributed networks. Overall, network structural gradient and interaction between local and distributed networks are of great significance for WM.