An Atlantic City man who admitted distributing fentanyl nearly two years ago was sentenced to five years in prison Tuesday, the Atlantic County Prosecutor's Office said.