The garda was rescued when colleagues in a patrol vehicle saw what was happening and went to his aid.
The victim is understood to have suffered a stab wound to one of his legs and blacked out from blows to his head.
He was taken to hospital and was kept in overnight. The incident began after the garda and a colleague were responding to a report of a stolen car at around 5am yesterday.
A Garda spokesman said: “During the apprehension of one of the males, a garda was injured, suffering head injuries and leg injuries.”
He said a number of individuals “tried to obstruct the arrest” at the Hillview Estate in Ballinteer, south Dublin.
Separate sources told the Irish Examiner that when the garda and his colleague originally came upon the suspected stolen vehicle, the two occupants abandoned the vehicle and fled on foot in separate directions.
The injured garda pursued one of the occupants to the estate, where he ran up to a house and started banging on the door.
Sources said that five men came out and attacked the garda. During the assault, the garda was “beaten around the head”, losing consciousness, and reportedly stabbed in the leg.
A second patrol car came onto the scene and rescued him and arrested two men.
The injured garda, stationed at Dundrum Station and thought to be in his early 30s, was brought to St James’s Hospital. Sources said his injuries turned out not to be serious, but he was kept in for observation.
The Garda spokesman confirmed that two men, aged 18 and 20, were arrested for public order and road traffic offences.
They are due to appear before Dún Laoghaire District Court next month.