From the 1977 film, The Mouse and His Child based on the Russell Hoban novel of the same name.
From a review of the novel by Dave Awl: "The recurring concept of 'The Last Visible Dog' becomes an eloquent metaphor for patience, persistence and determination, as the mouse and his child find that in order to realize their dreams of domestic contentment they must remain focused on a goal that seems further away than the eye can see, and travel farther than they ever dreamed."