The 77-year-old retired farmer lives alone in his isolated rural cottage at Aughabrack near Dunamanagh.
Neighbours heard him calling for help at about 20:00 GMT on Sunday.
Two men rushed to help and used their car to block the gang's vehicle. As they approached, three men came running out, their faces masked by scarves.
"All I saw was the barrel of the shotgun being pointed at us. One of the gang was shouting; 'Shoot them, shoot them'," one of the neighbours said.
As the men withdrew, the gang managed to escape. The two neighbours gave chase before losing them on country roads.
They returned to the house to find the elderly farmer badly shaken.
It is understood he suffered serious burns to his arm when he tried to throw boiling water at his assailants. He had also been threatened with a knife.
It's understood the shotgun used by the gang to threaten the neighbours belonged to the farmer. It was loaded.
The pensioner is staying with relatives.
Police are seeking information about a Seat car used by the gang. A Seat Toledo car CKZ 8800 was found burnt out at Daisyfield Park off the Letterkenny Road, Londonderry early on Monday.
SDLP councillor Patsy Kelly described the gang who carried out the attack were "cowards".
A gang of men who assaulted a County Tyrone pensioner during a robbery threatened to shoot two neighbours who came to his aid.