Without a doubt, the movie predates the game. The book, The Sheep Pig, by Dick King-Smith predates it even more so - published in 1983.

The whole quote (as spoken by the sheep) is

"Baa, Ram, Ewe. Baa Ram Ewe. To your breed, your
fleece, your clan be true. Sheep be true. Baa Ram Ewe.."

Interesting how they say "clan" there. I wonder if the sheep were intended to be Scottish?

Courtesy of the script for Babe.