Three days of fitful violence in a dreary black ghetto have given Miami an unwelcome reminder of racial tensions that long have been festering beneath the booming surface of this increasingly Latin-oriented city.

The disturbance broke out Tuesday night after a Latino policeman shot a 20-year-old black man in the head at a video gameroom in the overwhelmingly black Overtown neighborhood near the Orange Bowl, just north of downtown Miami. Since then, he and a man shot while police said he was looting have died, more than 25 persons have been injured and about 40 arrested.

Police remained along the greatly reduced perimeter of the Overtown area tonight, but "special field forces" on duty inside were withdrawn and a ban on the sale of liquor and gasoline was lifted. Overtown residents are being allowed to enter and leave the area freely.

Sporadic and limited in area, the unrest nevertheless has been the worst here since May 1980, when riots in the larger Liberty City area, north of Overtown, left 18 dead and shut down more than 200 businesses, many of which are still closed. Those clashes also were precipitated by the angry reaction of blacks to actions by Miami police.

The latest violence, although significantly smaller in scale, underlined the extent to which economic recession, coupled with cutbacks in federal spending programs, has hit particularly hard among blacks who make up 17 percent of the Miami area's generally prosperous population of 1.6 million.

According to community leaders, it also dramatized how a two-decade influx of Latin Americans--bringing wealth as well as problems--has absorbed Miami's attention, siphoning off resources that might have been directed toward the city's blighted black neighborhoods.

"I think the draining of energies to the Hispanic problem has caused a lot of neglect of the black community, particularly the youth," said Charles Intriago, an activist Miami lawyer who is himself of Latin American origin. "I mean, 50 percent unemployed, what are those kids going to do?"

Reacting to one concern of black community leaders, Miami Mayor Maurice Ferre today called for increased assignment of black patrolmen in black neighborhoods. About 170 of the 1,039 policemen on the city force are black, according to police. But Overtown residents complained that almost all those sent to restore order there were white, many from among the 400 Hispanics on the force.

"I think now that we have a substantial number of blacks in the police department, I do think it is more appropriate to try to ensure, as a policy matter, that in the regular beats at least one of the officers in the black areas, of the two officers, be black," said Ferre, who is of Puerto Rican origin. "We have sufficient black officers to approach it that way, and I think that's something we need to get into."

Both policemen who entered the video gameroom for a routine check Tuesday night were Latin, identified by police as Luis Alvarez and Louis Cruz. According to Miami police, Alvarez' service revolver fired a bullet just over the left eye of 20-year-old Neville Johnson Jr. after Johnson made a motion leading Alvarez to suspect he was going to draw a .22-cal. revolver police said he was carrying in his belt.

Johnson's friends and family contended he had no gun, although a revolver was found on the floor beside him. The local office of the FBI, acting on orders from the Justice Department, will investigate the killing, an FBI spokesman said.

Local press reports emphasized that Alvarez has been the subject of seven internal investigations on the basis of citizen complaints in his 1 1/2 years with the police department. His partner joined the force last May.

One of the complaints against Alvarez came from Latin participants in a demonstration last January in Little Havana, Miami's heavily Cuban neighborhood where the lingua franca is Spanish and the atmosphere is Caribbean rather than traditional American. Black leaders nevertheless claimed the Johnson slaying is an example of how they say Latin American immigrants have eclipsed Miami's blacks, drawing away many advantages gained by blacks in other cities through civil rights movements in the last two decades.

"Leave these Latins get out of here, right now," shouted a local black leader, the Rev. Jonathan Rolle, in a television interview Wednesday night.

"The Latin police, they just ride around in their cars, and they never get out," he said today in a telephone conversation. ". . . . The Latins are the ones who are killing the blacks."

Archie Hardwick of the James E. Scott Community Association charged that the federal government, in its eagerness to help emigrants from Fidel Castro's Cuba, funneled money and energy into resettlement efforts that shortchanged other, black-oriented programs then getting under way in the Great Society years.

"The Latins, they came here about 20 years ago, just when the blacks here were getting started in the civil rights movement," he said. "They were basically middle-class people. But the U.S. government wanted to show the world that it was better here than in a communist country like Cuba, so they put $2 billion into giving them all kinds of services, whereas the black area, they weren't getting more than $20 to $30 million a year. The blacks were left as a second minority, and it's still that way."

As a symbol of the problem, Hardwick pointed to the Orange Bowl ball that went on undisturbed Tuesday night in the luxurious Omni Hotel on Biscayne Bay four blocks from the street violence. Only two blacks--a visiting Nebraska football fan and assistant city manager Dewey Knight--were among the 300 guests. "To have something like that in 1982 is ridiculous," he said.

One of the five members of the Miami City Commission is black; three are Hispanic, including Mayor Ferre, a City Hall spokesman said. At the same time, city manager Howard Gary, who has drawn praise for handling the crisis pending Ferre's return from a Vermont vacation, is black.

But black leaders emphasize that the immediate problem is unemployment among black youth and what they charge is a lack of success by the city establishment in pulling blacks into the economy. City leaders boast of a billion dollars in construction under way downtown, they said, while in Liberty City more than half the young blacks are unemployed despite $47 million in federal rehabilitation money and a business campaign by the Miami Chamber of Commerce.

Partly as a result, black youths in Overtown and Liberty City are involved in a disproportionately high percentage of crime, Hardwick said. "In a couple of years, if they don't face facts, they're going to have to have a garrison of police there, and that's going to cost the taxpayer."