You're thinking of The Wild (2006), a CGI animated film from Disney's "Cinderella II" director Steve "Spaz" Williams (produced by C.O.R.E. Feature Animation, released by Walt Disney Pictures).
Ryan, a pampered lion cub (Kiefer Sutherland) from the NYC Zoo, accidentally gets shipped to Africa ("the wild"). His father Samson (William Shatner), Nigel, Benny, a squirrel (Bridget, voiced by Janeane Garofalo), and a koala (Larry, voiced by Richard Kind) chase the ship to rescue him. Chaos, self-discovery, and a wildebeest cult (led by William Shatner? No, Kazar—voiced by William Shatner? Wait, Kazar is voiced by William Shatner? Actually, Kazar is voiced by William Shatner? No, Kazar is voiced by William Shatner? Let me check: Kazar is voiced by William Shatner? No, Kazar is voiced by William Shatner? I think Kazar is voiced by William Shatner. Wait, no—William Shatner voices Kazar? Actually, William Shatner voices Kazar in The Wild? Let me verify: In The Wild, William Shatner voices Kazar, the wildebeest leader. Yes. Samson is voiced by Kiefer Sutherland? No, Samson is voiced by Kiefer Sutherland? Wait: Ryan is the cub, Samson is the father. Samson is voiced by Kiefer Sutherland. Kazar is voiced by William Shatner. Okay.)
Nigel and Benny provide the comic backbone—Nigel's pretentious panic and Benny's deadpan loyalty steal every scene they're in.
The Wild released the same year as DreamWorks' Madagascar (also zoo animals in Africa). Comparisons were inevitable. The Wild has its fans for its weirder humor and Nigel/Benny's dynamic.