Indira Gandhi, a longtime close political ally of Moscow's in the Third World, told Soviet Foreign Minister Andrei Gromyko today that a withdrawal of Soviet forces from Afghanistan is directly linked to the relaxation of tensions in the volatile Indian subcontinent.

India has grown increasingly nervous since the Soviet move into Afghanistan in late December as it has watched the United States move to rearm Pakistan and has seen China renew its interest in South Asia. India has fought bitter conflicts with both nations.

The Indian prime minister, according to a spokesman for the External Affairs Ministry, outlined India's growing concern about the course of events in neighboring Pakistan and Afghanistan in the same terms as were used in a recent joint Indo-French declaration.

That statement labeled the "use of force" and "intervention" in the internal affairs of countries as "inadmissible." It mentioned no specific country.

An Indian diplomatic source said, however, that it no doubt referred to the Soviets in Afghanistan.

Gandhi's meeting with Gromyko was her first with a high-ranking Soviet official since she was reelected to this country's top office Jan. 7.

Indian officials used guarded diplomatic language in saying that "India's views regarding the need for defusing the tensions in the area early" were "made known . . . clearly."

India has had a longstanding close relationship with the Soviet Union, particularly under Gandhi, and her position on the Soviet troops in Afghanistan will be watched closely by all parties involved as a signal as to whether she intends to put pressure on Moscow to withdraw.

There was no report on Gromyko's response to Gandhi, but the 71-year-old veteran diplomat was effusive when he left Gandhi's office after nearly three hours of talks, 25 minutes of that time with no aides present. Talks are to continue Wednesday.

"We are convinced our discussions will contribute to peace in Southeast Asia, South Asia and the world," he told All India Radio.

Gandhi, when asked how the talks went, replied, "As usual, frank."

Gromyko delivered a strong attack on U.S. policy in the area and sent a warning to Pakistan in a banquet speech tonight. His talk seemed particularly stident, following as it did Indian External Affairs Minister P. V. Narasimha Rao calling for restraint.

The Soviet foreign minister accused the United States of inflaming tensions in the area and of trying to restart the cold war. Gromyko said American "schemes are meant to convert Pakistan into a hotbed of tension, a springboard for further escalation of agression against Afghanistan."

At the same time, Gromyko warned Pakistan that it faces problems if it follows the same policy as the United States and China.

"Pakistan, if it goes along the same road in the future, will get nothing good and will undermine its position as an independent state," warned Gromyko. g

Almost every official Indian statement, including interviews with Gandhi and Rao's speech to Parliament, couples the Soviet invasion with the U.S. response of selling aid to Pakistan.

Rao, in his speech, said India felt "grave concern" that military aid to Pakistan would "convert the South Asia region into a theater of great-power confrontation and conflict."

In recent weeks India has tried unsuccessfully to forgo a regional alternative to stop what it fears will become a big-power battle in an area that it regards as within its sphere of influence.

To do this, top Indian diplomats and leaders of the new government have held a series of meetings here and elsewhere with representatives of nations that include the United States, Great Britain and France, as well as neighboring states such as Pakistan, Sri Lanka and Bangladesh.

There have been reports here and in Pakistan that India and the Soviet Union have concluded a still-secret $2.6 billion arms deal. Indian officials have strongly denied the report.

While denying that there had been a secret arms deal, one Indian diplomat warned that increased U.S. arms supplies to Pakistan "would drive us into Russia's arms."