I think this might be in the Yershalmi (Jerusalem Talmud) but which meseches and which page?
There was once a Jew who owned a cow with which he plowed his field. Then it came to pass that this Jew became impoverished and was forced to sell his cow to a non-Jew.
The new owner plowed with the cow throughout the week, but when he took her out to the field on Shabbat, she kneeled under the yoke and refused to do any work. He hit her with his whip, but she would not budge from her place.
So he came back to the Jew and said to him, "Take back your cow! All week I worked with her, but today I took her out to the field and she refuses to do anything... "
The Jew said to the cow's purchaser: "Come with me, and I will get her to plow." When they arrived at the field, the Jew spoke into the cow's ear. "Oh Cow, Cow! When you were in my domain, you rested on Shabbat. But now that my sins have caused me to sell you to this gentile, please, stand up and do the will of your master!"
Immediately the cow stood, prepared to work. Said the gentile to the Jew: "I'm not letting you go until you tell me what you did and what you said to her. Have you bewitched her?" The Jew told him what he said to the cow.
When this man heard this, he was shaken and amazed. He said to himself: "If this creature, which has neither language or intelligence, recognizes her Creator, should not I, whom G-d created in His image and likeness and imbued me with intelligence and understanding?"
So he went and converted to Judaism and merited to study Torah. He became known as Yochanan ben Torta ("Yochanan son of the Cow")