The defendants tarnished Wang's reputation and Zhang invaded his privacy by causing his personal information to be displayed online and knowingly sparking harassment of the man over his alleged affair and his wife's suicide, the notice said.
Both Zhang and Daqi's owner, Beijing Lingyun Interactive Information and Technology Co, were ordered to immediately delete the information relating to the case and publish an online apology.
Online witch hunts are popular in China, for example when Internet users work together to find the identity of corrupt officials. Such pursuits are called "human-flesh" search engines.
Wang lost his job after Internet users called his office to tell the story to his colleagues, the official Xinhua News Agency said.
"It has seriously hampered my normal life," Wang was quoted as saying.
Jiang Yan, Wang's wife, leapt to her death from the 24th floor of a building last December after writing in a blog that she suspected her husband of having an affair, and posting photos of the suspected woman with her husband, the court notice said.
Zhang, her university classmate, then started a Web site to commemorate Jiang and posted articles written by him and Jiang's family and friends. He also posted links to his Web site on other Web forums and displayed Wang's personal information.
Wang started being insulted online, and his workplace and home addresses were posted, the notice said.
It said some online users even went to Wang's and his parent's homes to harass them, painting slogans over their doors that said such things as "driving the good wife to death," and "blood must be repaid with blood."
The company was ordered to pay Wang Fei 3,683 yuan ($540) in compensation and court costs, and Zhang to pay 5,684 yuan ($832), the verdict said. Wang had sought compensation of 135,000 yuan ($19,750) for the trauma.
"This is the first lawsuit in the country related to 'online violence' or a 'cyber manhunt dispute'," the official China Daily quoted Yuan Jing, an information officer with the court, as saying.