The pair, orthopaedic surgeon Arshad Wahid and his brother, heart specialist Akmal Wahid, were detained in July 2004 after helping Afghan refugees.
They were arrested for alleged ties to Usama bin Ladin's network.
"We provided medical aid to Afghan refugees after the 2001 US attacks on Afghanistan," said Arshad Wahid on Monday.
"It is our job to provide medical treatment to anyone. We have no regrets and we would continue with our duty."
Their lawyer, Ghulam Qadir Jatoi, added: "This is a fit case for appeal as there is no evidence."
The brothers were also accused of having links with a radical group blamed for a deadly attack on the convoy of a Pakistan army commander in Karachi.
"Evidence against them is sufficient, therefore, they have been given the maximum punishment, which is seven years," judge Feroz Mahmood Bhatti said in his verdict.
Each was also ordered to pay a fine of 50,000 rupees ($839).
The court found the pair had provided medical aid to fighters from the Jund Allah, or Army of God, which was blamed for the attack on Lieutenant-General Ahsan Salim Hayat's convoy in June last year.
That attack left 11 people dead, including seven soldiers, three policemen and a passerby. Hayat, who narrowly escaped the attack, is now working as vice-chief of the army staff.
Both doctors were also charged with providing medical treatment to two foreign al-Qaida operatives, Abu Hashim and Abu Musab, and sending local fighters for training in the lawless tribal areas near the Afghan border.
The verdict was announced in a make-shift court room inside Karachi's central prison.