A congressional panel voted yesterday to give the District of Columbia a long-sought power to tax the incomes of commuters who work in the city, a measure that, if enacted, could add $200 million a year to the municipal treasury.

Although Mayor Walter E. Washington declared himself elated by the action of the House District of Columbia fiscal and government affairs subcommittee, the bill's chief sponsor said it probably came too late in the congressional session to assure enactment this year.

Rep. Herbert E. Haris (D-Va.), a leading foe of the commuter tax, said he will do everything possible to block passage of the bill, which is strongly opposed by his suburban constituents.

The city's home rule charter, which went into effect in 1975 after its approved by Congress, prohibits the city from taxing the incomes of commuters. The new bill, sponsored by Rep. Ronald V. Dellums (D-Calif.), would remove that prohibition, leaving the matter up to the D.C. City Council.

Dellums' bill was approved, 6 to 0, by the subcommittee, which took 85 minutes after the scheduled start of its 9 a.m. meeting to round up a quorum. Harris, a subcommittee member, walked out of the committee room when it looked for a time as though his presence would have created that quorum.

To become law, the measure must be approved by the parent District Committee and the full House of Representatives, then must follow a similar legislative path through the Senate. With Congress pushing for an Oct. 7 adjournment, Dellums acknowledged the chances for final passage this year seem slim.

But, Dellums insisted, approval by the House this year should improve chances for full enactment early in 1979.

Dellums said talks with many House members convinced him that a congressional bill establishing a D.C. cummuter tax would fail, but a bill removing the restriction on the city's power to levy one stands a good chance of passage.

"It's time for Congress to stop engaging in colonialism," Dellums told reporters.

The city first officially proposed a tax on commuters' incomes in 1971, before home rule, but it was not until 1976 that the first bill to authorize one was approved by the same subcommittee that took yesterday's action.

With Harris leading the opposition, the bill failed to clear the District Committee and reach the House floor.

The D.C. government, contending that its resources are limited, has estimated that about 60 percent of the income earned by jobholders in the city is taken to the suburbs. The mayor and other officials have insisted that the District should have the same right as the states to tax nonresident income.

City officials have estimated that the tax could raise about $200 million a year, which - depending upon arrangements yet to be made - suburbanites could deduct from their homestate taxes.

Harris, in a statement, quoted Virginia Tax Commissioner W. H. Forst as saying that his state would lose $68 million to $78 million in diversions to the District. To make it up, Forst said, the state would have to take such steps as raising its top personal income tax bracket throughout the state from 5.75 percent to 7.25 percent.

Marvin Bond, spokesman for Maryland Comptroller Louis L. Goldstein, said no similar estimate for that state was immediately available. But he said Goldstein regards the bill as "a raid on Maryland's treasury."

It took only about two minutes for the subcommittee to act on the bill yesterday after a motion for approval was made by Del. Walter E. Fauntroy (D-D.C.).

In addition to Fauntroy and Dellums, those present and voting for the bill were Reps. Stewart L. McKinney (R-Conn.), Charles W. Whalen (R-Ohio) and Marc L. Marks (R-Pa.). A proxy vote in favor was cast for Rep. Ted Risenhoover (D-Okla.), who was absent.