A city official was grilled yesterday about the FDNY’s decision to hire two of the four white police officers who fatally shot African immigrant Amadou Diallo — while rejecting black applicants with convictions for minor offenses.

Brooklyn federal Judge Nicholas Garaufis is presiding over a special trial in hope of learning how to attract more minority applicants to the Fire Department.

Diallo was killed in 1999 in a 41-bullet barrage. The cops who shot him said they thought he was going for a gun. All were acquitted. It turned out he was reaching for his wallet and ID.

White firefighters’ references to the Ku Klux Klan and a noose placed in a black firefighter’s locker are but two of the workplace horror stories that Garaufis can expect to hear about, according to the Vulcan Society, the black firefighter group behind the lawsuit.

Together, blacks and Latinos make up 53 percent of the five boroughs’ population. Yet they combined for only 10.1 percent of the city’s 8,998 firefighters when the civil-rights suit was filed in 2007.