In 5G, multi-access edge computing enables the applications to be offloaded to near-end edge servers for faster response. According to the 3GPP standards, users in 5G are separated into many types, e.g., vehicles, AR/VR, IoT devices, etc. Specifically, the high-priority traffic can preempt edge resources to guarantee the service quality. However, even if a traffic is transmitted with low priority, its latency requirement in 5G is much lower than that in 4G. Too strict latency requirement and priority-based service make resource configuration difficult on the edge side. Therefore, we propose the edge-cloud offloading mechanism, in which each edge server can offload tasks to back-end cloud server to ensure service quality of both high-and low-priority traffic. In this paper, we establish a priority-based queuing system to model the edgecloud offloading behaviors. Based on the formulation of our system model, we propose Knapsack Potential Game (KPG) to derive an optimal offloading ratio for each edge server to balance the cost-effectiveness of the overall system. We demonstrate that KPG has low computational complexity and outperforms two baseline algorithms. The results indicate that KPG's performance is optimal and provides a theoretical guideline to operators while designing their edge-cloud offloading strategies without large-scale implementation.