NEW YORK (AP) _ U.S. Roman Catholic and Jewish representatives have reached a consensus on the difficult issue of treating handicapped newborns, agreeing that withholding potentially helpful treatment is not justified.

The accord announced Thursday was said to be the first between the two faiths on responsibilities to infant life, and touches on recent and pending court cases.

After a year of discussions growing out of the ''Baby Doe'' and ''Baby Jane Doe'' controversies, the American Jewish Congress and the Pro-Life Committee of the National Conference of Catholic Bishops declared:

''Every newborn has the right to basic care: nurture, sustenance and relief from pain. In cases where parents are unable or unwilling to provide such care, our government should take all reasonable steps to do so.'' An agreed-upon set of ''principles on treatment of handicapped newborns'' rejects any discrimination against defective infants solely because they are handicapped, saying:

''Handicaps, in and of themselves, do not justify withholding medical treatment when such treatment offers reasonable hope of benefit and does not impose excessive pain or other burdens on the patient.''

However, the accord said ''medical intervention is not required'' when it would be ''clearly futile and would do no more than briefly prolong the act of dying.''

If medical experts disagree about the effectiveness of treatment ''for a life-threatening situation,'' then parents are obligated to decide about it, but should do so in ''their child's best interest,'' the agreement says.

It says the government should intervene in parental choices only if there is a ''preponderance of evidence'' that non-discriminatory principles regarding handicapped children are being violated.

Richard Doerflinger, assistant director of the bishops' committee, said that so far as had been determined, Catholics and Jews had not previously spoken jointly on ''this particular issue.''

Israel E. Levine, a spokesman for the Jewish group, termed the agreement ''very unusual, a very rare situation.''

An accompanying joint statement says the accord represents a ''significant consensus on both medical ethics in general and the rights of citizens with disabilities in particular.''

The statement says, ''Respect for the inherent dignity of human life demands that basic sustenance and care be provided to handicapped infants,'' regardless of whether medical steps are needed to correct a life-threatening situation.

While the accord stemmed from the ''Baby Jane Doe'' and ''Baby Doe'' cases, the conclusions were not explicitly applied to those cases and instead concentrated only on laying down basic principles.

In the 1982 ''Baby Doe'' case, a child born with Down's syndrome and a closed esophagus, not opened by surgery to allow feeding, died of starvation. A court refused to intervene in that parental decision.

In the 1984 ''Baby Jane Doe'' case, parents also decided against surgery on a child with spina bifida (an unclosed spine) and hydrocephalus (water on the brain, which can result in retardation). A court disallowed any intervention. The spine subsequently closed, and the child, although retarded, is still alive.

Federal efforts to lay down hospital rules regarding care of handicapped infants have been struck down by lower courts, and an appeal is being readied to the U.S. Supreme Court.

The Jewish-Catholic accord says the government should ''lend its support to the continuing treatment and care of handicapped children'' so parents can make decisions about it without ''undue financial pressure.''