Zainuddin was pronounced dead with multiple gunshot wounds to the head and chest upon arrival at the local hospital, a local doctor said.
Al Jazeera's Kamal Hyder, reporting from the Pakistani capital Islamabad, said: "Zainuddin had accused Baitullah Mehsud of going against the tenets of Islam for carrying out attacks on religious scholars.
"He said he would take his men and go after Baitullah Mehsud."
Baz Mohammad, one of Zainuddin's aides, was also wounded and said that the guard stormed into a room at the compound immediately following morning prayers and opened fire. Mohammad accused Mehsud of organising the attack.
"It was definitely Baitullah's man who infiltrated our ranks, and he has done his job," Mohammad said.
Mahmood Shah, a former Pakistani security official, said that the incident sends a message to the government that it must launch a comprehensive operation to eliminate Mehsud.
"You simply can't eliminate him through local efforts; instead, you need a major force," Shah said.
The military has been attacking fighters loyal to Mehsud, Pakistan's Taliban leader, in the South Waziristan region that borders Afghanistan.
On Monday, Taliban fighters used rockets, mortars and other weapons to attack Pakistani military positions in the northwest, but the military responded swiftly with air raids that left at least 25 dead, officials said.
Zainuddin had denounced Mehsud for attacks that left two civilians dead, attacks that had apparently been launched in retaliation for an army offensive in the Swat Valley.
Zainuddin had said: "Whatever Baitullah Mehsud and his associates are doing in the name of Islam is not a jihad, and in fact it is rioting and terrorism.''
The motive for criticising Mehsud was not clear, but whatever the reason, it has exposed divisions within the tribes.
Hyder said: "For the first time, there is a real sign showing there is a split within the tribes in that particular area and that is happening just as the military operation is under way."
"In the past, whenever there has been a confrontation between the military forces and loyalists of Baitullah Mehsud, there had been political intervention and talks to try to negotiate a settlement.
"But now the government is determined to go after Baitullah Mehsud.
"The military has decided it wants to take on Baitullah Mehsud for the first time in a determined and concerted manner."
While Mehsud has not claimed responsibility for the attack on Zainuddin, Hyder said that "his death would be a set back for the military which was planning its military operation in South Waziristan."