The D.C. City Council's Committee of the Whole yesterday approved a 6 percent pay raise for nonunion city workers next month that for the first time would make District salaries higher than federal salaries at all but the highest grade levels.

The committee also approved an increase in the salary ceiling for top-level officials from $56,301 to $63,700, after defeating an attempt by City Council member John A. Wilson (D-Ward 2) to maintain the current limit. The ceiling affects 259 District employes at grade levels DS15 to DS18. About 140 of these top officials would get raises of $7,399 a year because their salaries would go all the way to the new ceiling.

The 6 percent increase would apply to more than 7,400 city workers who are not subject to collective bargaining, generally white-collar supervisory personnel, and is comparable to raises going into effect for union workers.

In addition, about 282 nonunion police and fire employes would get 7 percent raises, the same as union workers in those departments are scheduled to receive.

The council is scheduled to consider the pay raise resolution at its Sept. 20 legislative session, and yesterday's vote was seen as a good indication that it will be approved there. The raises are scheduled to go into effect Oct. 2.

Before approving the raises as proposed by Mayor Marion Barry this month, members defeated by a 7-to-5 vote Wilson's attempt to keep the cap at its current level. Keeping the current limit would have saved the city about $1.9 million in fiscal 1984, city officials estimated.

"If there are any surplus revenues to be spent in fiscal year 1984, I can think of better place to use them then in increasing the salaries of persons who already earn over $50,000 a year," Wilson said.

He noted the many budget cuts that the council has had to approve this year for schools, housing, the unemployed and the court system, and the increases in various fees for District residents. Giving raises of more than $7,000 to "a privileged few or a powerful few . . . is outrageous in these fiscally uncertain and troubled times," he argued.

But other council members said that the District needs to keep pace with increases elsewhere to attract well-qualified people to work for the city. And Council Chairman David A. Clarke said he was unwilling to give top officials no pay increase.

Until 1981, the city and federal governments used the same General Schedule salary scale, but that year the city started its own District Service scale for its employes. The federal government's scale quickly increased to a higher level than the District's, but the planned 6 percent raises would change that.

Employes at grades DS1 to DS15 would be paid more than their federal counterparts at GS1 to GS15, regardless of whether federal workers get a 3.5 percent raise in January as proposed by President Reagan or a 4 percent raise being considered on Capitol Hill. A DS15, Step 1, for example, would make $51,058 under the city's proposed schedule, or about $800 more than a GS15, Step 1, under the president's plan.

At levels DS16 to DS18--generally department heads and deputy mayors--the $63,700 cap would still keep employes below the federal limit, currently $63,800, that applies to most at the GS16 to GS18 levels. This can be expected to rise in January with the other federal increases.

Voting with Wilson to maintain the current District limit were council members Polly Shackleton (D-Ward 3), Betty Ann Kane (D-At large), Hilda Mason (Statehood-At large) and Frank Smith (D-Ward 1). Council member Nadine P. Winter (D-Ward 6) was absent.