Exhibit 23.1 CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM We consent to the incorporation by reference in Registration Statement Nos. 333-119474 and 333-40472 of KeySpan Corporation on Form S-8 of our report dated June 22, 2006, appearing in this Annual Report on Form 11-K of KeySpan Energy 401(k) Plan for Management Employees for the year ended December 31, 2005. /s/ Deloitte & Touche LLP New York, New York June 22, 2006 14