Tony Bennett got a jump on celebrating his 90th birthday Wednesday night, as Billy Joel and the crowd at the sold-out Madison Square Garden sang “Happy Birthday” to the legendary singer.

Bennett, who actually turns 90 on Aug. 3, was on hand to sing “New York State of Mind” with Joel and his band at the Piano Man’s monthly residency. Their duet found them both in fine voice and pushing each other to reach higher notes toward the end of the city anthem.

advertisement | advertise on newsday

Bennett applauded the fans as they paid tribute him, as Joel said, “Thank you, Mr. Bennett.” The Astoria native then blew kisses to the crowd as he left the stage.

Backstage, Joel presented Bennett with a black-and-white birthday cake with the crooner’s face on it.

Bennett is expected to spend his actual birthday with family and friends at an invite-only party at the Rainbow Room, though plans are reportedly in the works for a more public celebration later this summer or in the early fall.

Bennett’s next big project will be the release of his second book, “Just Getting Started,” which is due out in November from Harper Collins, where he discusses those who have inspired him — from Charlie Chaplin to Amy Winehouse, from Martin Luther King Jr. to Lady Gaga.