After one of Frank's gang members got shot by Sullivan's troops, he told Billy that he gave him the wrong address and he knew that he was the snitch, but why didn't he say anything?
There's a deleted scene in the movie where they have a longer conversation. Here's a YouTube clip of the extended scene.
As Delahunt dies, he says that the boss (Jack Nicholson) asked him earlier if he would kill the rat if they find out who it is. Delahunt, who has never killed anyone, says he would. But in reality, Delahunt feels uncertain. Before he dies he says he now knows he can't kill anyone, and doesn't tell anyone about Billy being the rat because he doesn't want to be responsible for Billy's death.
Snippet from the original script below:
This is from the script...
DELAHUNT You know what I thought today? BILLY What's that? DELAHUNT Who didn't show up today is the rat. BILLY Yeah, so? DELAHUNT You never been late in your life. And when I called you... I made a mistake. I gave you the wrong address. But you showed up at the right one. DELAHUNT grips his arm. BILLY is terrified. DELAHUNT (CONT'D) Tell me why I didn't say anything. Tell me why.
So, it looks like we're going to find out, but...
He waits for DELAHUNT to continue. But DELAHUNT after an odd smile of complicity, finally dies. BILLY, the only one who knows that DELAHUNT is dead, stares down at him.
So, the writer left it to the audience to figure out why. Here's Scorcese discussing it, leaving the ambiguity.
The cops at least pretend Delahunt was a cop to get the heat off Billy.
Delahunt was later shot by police after the murder of Oliver Queenan. He was bleeding on a couch at the gang's hideout when Fitz came over and told him that a doctor was coming but traffic was slowing him down. He called over Costigan and revealed that he knew Billy was the rat because he knew to go to 344 Wash even though Delahunt mistakenly told him to 314 Wash. Delahunt dies before he could alert the other gang members. The SUI plants a story on the local news that Delahunt was a cop, attempting to assure Costello that his rat was gone in order to take the heat off of Costigan.
Theories abound, but only Delahunt knows for sure, and he's dead.