Kevin Ogg, 39, of Wedderburn Street, was jailed by Sheriff Alastair Brown at Dundee Sheriff Court after admitting dealing in heroin.
Ogg admitted that he was concerned in the supply of diamorphine at Flat A, Blackness Road, on September 3.
Fiscal depute Joanne Smith told the court that Ogg had been detained by police on another matter and when they searched his house they found three wraps of brown powder.
The street value of the drugs was estimated at more than £1,150 which Ogg admitted was what remained of a larger quantity.
Solicitor Paul Parker Smith told the court Ogg had already been returned to prison from an early release on licence for another similar offence for which he had served more than three years.
He said the heroin was for Ogg and his girlfriend who got through 3-4 grammes of the drug every day.
He said £400 of drugs would get him through a week at the most but he was also selling to finance their habit.
“He insists he was not pushing,” Mr Parker Smith added.
Sheriff Brown told Ogg: “It has been made clear repeatedly that those who deal in drugs at any level cannot expect the sympathy of the courts.
“You were convicted at the High Court and you were out on licence at the time.”
Ogg was jailed for two years.