The leak sheds further light on the close relationship between Cameron and Brooks, who live near each other in Oxfordshire.
Brooks's husband, racehorse trainer Charlie Brooks, was at Eton with Cameron.
This year Brooks told the Leveson inquiry that Cameron signed some of his missives to her "LOL" - mistakenly thinking it meant "lots of love" rather than "laugh out loud".
Both of the messages disclosed by the MoS were sent in October 2009, shortly after Brooks left her job as editor of The Sun and became CEO of News International, which owns the paper.
In one, Cameron wrote: "The horse CB (Charlie Brooks) put me on. Fast, unpredictable and hard to control but fun. DC."
After his conference speech, Brooks texted: "Brilliant speech. I cried twice. Will love 'working together'."
Questions about Cameron's close links with Rupert Murdoch's media empire, and Brooks in particular, came to the fore after the phone-hacking row erupted.
In her Leveson evidence, Brooks said that at the height of the scandal in 2010 he sent a message through an intermediary urging her to "keep your head up" and expressed his regret he could not be more loyal in public.
It had also emerged that the Conservative leader rode a police horse, Raisa, lent to Brooks by the Metropolitan Police.
Lord Justice Leveson is believed to have received a large amount of correspondence from the prime Minister, Brooks and former Downing Street communications chief Andy Coulson.
However, the inquiry's lead counsel, Robert Jay QC, has indicated that only "relevant" documents will be released.
Labour frontbencher Chris Bryant has challenged Cameron to publish all the material himself, suggesting he was delaying because it was "too salacious and embarrassing".
Brooks and Coulson, an ex-editor of the News of the World, are among those facing trial for conspiracy to access voicemails.
In a separate case, Brooks and her husband are among a group charged with conspiracy to pervert the course of justice.
A Downing Street spokesman said: "The prime minister has always been happy to comply with whatever Lord Justice Leveson has asked of him."
- AAP