The deformation behaviors of nanocrystalline high-entropy ceramics are complex and remain poorly understood, despite the critical importance to their performance and applications. Here, we employed molecular dynamics simulations to examine the shear deformation mechanisms of nanocrystalline high-entropy carbide ceramic, n-(Ti0.2Zr0.2Nb0.2Hf0.2Ta0.2)C, across grain sizes ranging from 4.0 to 12.0 nm. The atomic interactions were described using a machine-learning force field, which was developed based on deep neural networks. The simulation results reveal that the main deformation mechanism of n-(Ti0.2Zr0.2Nb0.2Hf0.2Ta0.2)C is grain boundary (GB) sliding, which then leads to the nucleation and growth of cavities and cracks at the GBs, ultimately resulting in intergranular fracture. For larger grains, the reduced soft GB volume fraction inhibits the GB sliding, leading to an inverse Hall-Petch behavior in n-(Ti0.2Zr0.2Nb0.2Hf0.2Ta0.2)C. Additionally, GB segregation often strengthens GBs, thereby enhancing the strength of n-(Ti0.2Zr0.2Nb0.2Hf0.2Ta0.2)C and mitigating intergranular fracture. These findings shed light on the deformation behaviors and underlying mechanisms of nanocrystalline high-entropy carbide ceramics, and they provide important guidance for the design of high-entropy ceramics with superior performance.