Prosecutor Mehmet Selim Kiraz died in the hospital from injuries he suffered during the attack, Prime Minister Ahmet Davutoglu said, speaking to reporters on Turkish television.
The two gunmen who took the prosecutor hostage were killed in a shootout with police after a standoff that lasted for hours.
The teen died the following March after having spent nine months in a coma. The case, with its overtones of possible police overreaction, has been politically contentious, just as the protests themselves were.
In an online post widely cited in Turkish media, the left-wing Revolutionary People's Liberation Party-Front claimed responsibility for the attack. The post said the gunmen were seeking to avenge Elvan's death.
President Recep Tayyip Erdogan described the gunmen as terrorists and said they were disguised as lawyers when they entered the courthouse.
"This is not to be taken lightly," he said.
The gunmen took the prosecutor hostage around 12:30 p.m. in his office on the sixth floor of the Caglayan district courthouse, the semiofficial Anadolu Agency reported.
Police evacuated that floor of the building, the agency reported, and snipers were deployed.
An explosion, followed by sounds of more gunshots, could be heard coming from the courthouse Tuesday evening, hours after the siege began.
Istanbul Police Chief Selami Altinok said Kiraz had been shot before Turkish security teams entered the room where the hostage crisis was unfolding.
"There is nothing else to do but to pray at this moment," Erdogan said.
The Revolutionary People's Liberation Party-Front, known as the DHKP-C, is viscerally hostile to the Turkish state, the United States and NATO
, and has had links with the far left in Europe.
The Marxist-Leninist group claimed responsibility for a 2013 suicide bombing at the U.S. Embassy in Ankara
Among other attacks attributed to the DHKP-C was the assassination of a former justice minister, Mehmet Topac, in 1994, as well as the murders of a number of senior police and military officials and, 1996, a prominent businessman, Ozdemir Sabanci.