When a much-loved gag from Billy Wilder’s “Some Like It Hot” shows up halfway through this new animated movie from Illumination, the company behind the Minions Empire, you know you’re in pretty assured hands. “The Secret Lives of Pets” may basically just be “Toy Story” with animals, but at least the makers have chosen a good model and employed it engagingly.

The premise of the script by Cinco Paul and Ken Daurio is a simple one: when pets’ owners are away, the animals not only converse among themselves but act pretty much as they like, often at odds with the way they do when observed by their humans. So while Jack Russell Terrier Max (voiced by Louis C.K.) is devoted to Katie (Ellie Kemper), doing all he can to discourage her from leaving him alone every day, when she goes off to work he connects with his usual pals in nearby Manhattan apartments. They include Gidget (Jenny Slate), the white Pomeranian who desperately wants to be his girlfriend; Mel (Bobby Moynihan), a hyperactive pug; Buddy (Hannibal Buress), a dachshund who uses a mixmaster as a rubbing tool; chirpy parakeet Sweet Pea (Tera Strong); Tattoo (Michael Beattie), a slow-witted pig; and even the self-absorbed Garfield-like cat Chloe (Lake Bell) who lives upstairs. Popping up occasionally is Norman (Chris Renaud), a guinea pig who prowls the ventilation system in search of his apartment.

Max’s happy existence changes for the worse when Katie brings home another dog—Duke (Eric Stonestreet), a big Newfoundland she rescued from a shelter. Not only does Max not want to share, but Duke is no slouch at demanding more than half of everything. The duo is forced to work together, though, when they get separated from their dog-walking group and find themselves on their own in the city. Threatened by alley cat Ozone (Steve Coogan) and his crew and caught by animal control, they’re freed by a surly little rabbit named Snowball (Kevin Hart), who leads “the flushed pets,” a group of abandoned critters determined to take revenge on humankind, after Max persuades him that they’re bad dudes, too. When Snowball takes them to his lair in the sewers, however, their imposture is revealed, and they’re on the run again—to Brooklyn.

While Max and Duke bond over a series of adventures—a feast in a sausage factory, a visit to Duke’s old homestead (the movie’s most notable attempt at sentiment)—Gidget is mounting a locate-and-rescue operation in which, along with Max’s neighbors, she enlists an unlikely ally—Tiberius (Albert Brooks), a red-tailed hawk kept in a rooftop shed whose appetite she has to keep in check. They eventually link up with Pops (Dana Carvey), an old basset hound with wheels for hind legs who’s a sort of animal godfather and takes them to Snowball’s lair. Their arrival sets off another frantic chase that brings animal control back into the picture and, eventually, an unlikely alliance between Max and Snowball.

Under the practiced direction of Chris Renaud, “Pets” is fast-moving and antic, and if it devolves into one long chase, that’s pretty much a standard requirement in today’s animated fare. Though the more sedate, saccharine moments never reach the emotional resonance of those one finds in the best Pixar product, they do offer a little breathing space from the mayhem. And the characters are amusing, even if they don’t achieve instant classic status. Max and Duke are an agreeably mismatched pair, but Snowball steals virtually every scene he’s in, simply because the undersized bunny is so intensely voiced by the equally diminutive Hart, who brings the same over-the-top shtick to his voice work that he customarily does to his live-action efforts on screen and in his stand-up.

Among the secondary characters, Bell’s Chloe (a delightfully sour puss, with some of the script’s best lines), Brooks’ Tiberius (who turns his usual dour tone into something more menacing) and Carvey’s droll Pops come off best, but all the actors throw themselves into their roles with abandon.

From the visual point of view, this is the best work yet to come from Illumination Entertainment—colorful and crisp, with 3D effects that don’t add much but don’t detract either. The company, however, is well aware of the most popular item under its brand, and proves it by having a new “Minions” cartoon introduce the picture. “Mower Minions” certainly proves that the little yellow critters’ slapstick works better in four-minute doses than at feature length.

The addition of the short will probably make “The Secret Life of Pets” even more attractive to both kids and their patents. But the movie is quite enjoyable enough on its own.