A court in the western German city of Duisburg found the defendants, aged 18 and 23, guilty of dozens of counts of violating copyrights and hacking confidential data, a spokesman said. Their names were not released.
The teenager was handed an 18-month sentence at a young offenders' institute while the older defendant received an 18-month suspended sentence.
The two used Trojan horse software to gain access to the computers and email accounts of the managers of high-profile artists, took unpublished songs and offered them for sale or download in 2009 and 2010.
In addition, the 18-year-old downloaded explicit private photos from Ke$ha's computer and blackmailed her to give him an audio "shout out" which he could use to boost his own status in the hacker scene.
"The court considered the fact that both defendants are attested to be highly addicted to the Internet to be a mitigating factor," the spokesman said, adding that full confessions given to the court had also counted in their favor.
Defense attorneys asked the court to call the affected artists as witnesses but the judges rejected the bid.
The 18 year old, identified in the German press only as Deniz A., had sent a letter of apology to Lady Gaga in December that was published in the daily Bild.
"Dear Lady Gaga," Deniz A., who reportedly called himself DJ Stolen, wrote.
"I am ashamed of what I have done. I did not think about the consequences."
The court said it would review his detention within six months and consider converting it to a suspended sentence.