Canon Answer
We do not know. There is no mention of who was Viserys III's namesake in the books. The main series makes no mention of it or Viserys' birth at all. Only account of his birth we see is in The World of Ice and Fire. And that itself makes no mention of who his namesake was.
His Grace’s new fidelity was apparently pleasing to the Mother Above, it must be said, for the following year, Queen Rhaella gave the king the second son that he had prayed for. Prince Viserys, born in 276 AC, was small but robust, and as beautiful a child as King’s Landing had ever seen.
Though Prince Rhaegar at seventeen was everything that could be wanted in an heir apparent, all Westeros rejoiced to know that at last he had a brother, another Targaryen to secure the succession. The birth of Prince Viserys only seemed to make Aerys II more fearful and obsessive, however. Though the new young princeling seemed healthy enough, the king was terrified lest he suffer the same fate as his brothers
Speculation based on available information
As you can see, there is no mention of why he was named as such. But we can use the other information in the chapter to speculate.
Queen Rhaella had two miscarriages and one stillborn before giving birth to Prince Daeron who died in infancy. This was followed by another stillbirth and another miscarriage. Then Prince Aegon was born two months premature and died in infancy. The King disowned all these children after their deaths and claimed they were bastards, struck down by Gods to secure sanctity of the throne by keeping bastards off it, presumably a coping mechanism for his grief. After that, Princess Shaena was also stillborn although Aerys never disowned her to our knowledge. She was followed by Prince Jaehaerys who also died in infancy. Viserys was born after Prince Jaehaerys.
As evident from his sons' names (Daeron, Aegon, Jaehaerys and Viserys), all of them share the names of previous Targaryen monarchs. Only Rhaegar had a unique name. In light of this info, we can reasonably speculate that Viserys was named after an illustrious ancestor like his dead brothers, not simply because the King liked the name.
Now that we have somewhat established he was indeed named after a King, we get to your question: Viserys I or Viserys II? We have to go to the main series to find impressions of the learned people of Westeros who are more or less contemporaries of Aerys II. The conversation between Prince Oberyn and Tyrion Lannister (ASOS - Sansa IV) on historical representation of Viserys II provides some insights:-
"I once had the great good fortune to see the Citadel's copy of Lives
of Four Kings," Prince Oberyn was telling her lord husband. "The
illuminations were wondrous to behold, but Kaeth was too kind by half
to King Viserys."
Tyrion gave him a sharp look. "Too kind? He scants Viserys shamefully,
in my view. It should have been Lives of Five Kings."
The prince laughed. "Viserys hardly reigned a fortnight."
"He reigned more than a year," said Tyrion.
Oberyn gave a shrug. "A year or a fortnight, what does it matter? He
poisoned his own nephew to gain the throne and then did nothing once
he had it."
"Baelor starved himself to death, fasting," said Tyrion. "His uncle
served him loyally as Hand, as he had served the Young Dragon before
him. Viserys might only have reigned a year, but he ruled for fifteen,
while Daeron warred and Baelor prayed." He made a sour face. "And if
he did remove his nephew, can you blame him? Someone had to save the
realm from Baelor's follies."
Sansa was shocked. "But Baelor the Blessed was a great king. He walked
the Boneway barefoot to make peace with Dorne, and rescued the
Dragonknight from a snakepit. The vipers refused to strike him because
he was so pure and holy."
"My prince is playing with you, Lady Sansa," said the woman Ellaria
Sand. "The septons and singers like to say that the snakes did not
bite Baelor, but the truth is very different. He was bitten half a
hundred times, and should have died from it."
"If he had, Viserys would have reigned a dozen years," said Tyrion,
"and the Seven Kingdoms might have been better served. Some believe
Baelor was deranged by all that venom."
So here we can see that even among the learned circles (Both Oberyn and Tyrion are very well versed in History), Viserys II is a polarizing figure. It appears that people suspect him of kinslaying and consider him of little note due to his brief reign. Some like Tyrion however admire him for his long and successful tenure as the hand, prior to becoming the King. There is no similar impressions on Viserys I by the contemporaries of Aerys II so we must rely on the writings before his time. Viserys I is described in TWOIAF and F&B in following words:-
Viserys I Targaryen had a generous amiable nature and was well loved by his lords and smallfolk alike. The reign of the Young King, as the commons called him upon his ascent, was peaceful and prosperous.
Viserys I Targaryen was not the strongest-willed of kings, it must be said; always amiable and anxious to please, he relied greatly on the counsel of the men around him and did as they bid more oft than not.
He had ruled for six-and-twenty years, reigning over the most prosperous era in the history of the Seven Kingdoms but seeding within it the disastrous decline of his house and the death of the last dragons.
Here we can see that while Viserys I was not considered particularly strong-willed and decisive and somewhat blamed for the Dance in retrospect, he is still seen as the King who presided over the Golden era of Targaryen dynasty, ushering in a long period of peace, prosperity and justice for all.
In light of this information, we can reasonably speculate that Viserys III is named after Viserys I. Kinslaying is a big stigma and while some may argue that Royals may not have cared for public opinion, let us not forget that Prince Maegor (Son of Prince Aerion), lost his chance at the throne for a number of reasons, one of which was being named after Maegor the Cruel. Furthermore, Viserys II's actual reign was inconsequential so it wouldn't make sense for Aerys to name his second son after him.
In any case, it must be noted that it all in the end goes back to Viserys I as Viserys II himself was named by Rhaenyra for her father Viserys I.