Grant Yuill, 38, of Porthmadog, Gwynedd, was found guilty of supplying the drug and of child cruelty.
He had also been supplying heroin to the child's mother.
Sentencing, the judge at Caernarfon crown court told Yuill: "This is a case of serious cruelty over a period of time."
The little girl is now in care, and her mother, Nia Wyn Jones, 31, was jailed for three years for supplying methadone to her and for child cruelty.
More:Advice And Health
Suggested For You
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements. Learn more