Islam had introduced the Chesterfield teen to the world of crime but when the 16-year-old said he no longer wanted to be involved, Islam drove him around Sheffield for four hours and threatened him.
Islam, 20, was sentenced to 65 months in a young offender institution after admitting false imprisonment and supplying heroin and cannabis.
He first met the boy in Chesterfield last year and persuaded him to sell small amounts of cannabis a day for him. But this soon escalated to selling hundreds of pounds worth of heroin daily and the youngster told Islam he wanted to stop.
On July 13, Islam turned up at the house the boy was at and dragged him out and into the car. A second man in the vehicle ordered him to strip while Islam threatened him. At one point, the boy had a gun pointed to his head.
Eventually, he was let out at Sheffield train station and he later told his mother what he had been involved in.
Police worked with partner agencies to safeguard the boy and he and his family have been moved away from the area.
Islam, of Glen Road, Sheffield, was sentenced at Derby Crown Court.
DCI Darren Pope said: “Islam talked this naïve teen into selling drugs and he would travel from Chesterfield to Sheffield by train to collect the drugs.
“But the situation soon became far more serious when Islam pressured him into selling harder drugs.
“It must have been a terrible ordeal for this youngster and I’m pleased that we have been able to help him and his family move away from the area.”