Ivan A. Nestingen, 56, a supporter of John F. Kennedy in the crucial 1960 Wisconsin presidential primary campaign and later an under secretary of the Department of Health, Education and Welfare, died Monday following a heart attack in his Washington law office.

Mr. Nestingen was the mayor of Madison, Wis, at the time of the 1960 Democratic primary. He was chairman of the Kennedy for President Club of Wisconsin in 1959 and 1960, and chairman of the Citizens for Kennedy-Johnson of Wisconsin in the 1960 general election.

Kennedy defeated the late Sen. Hubert H. Humphrey in the primary, and Richard M. Nixon for president.

Kennedy later named Mr. Nestingen to the HEW post. Mr. Nestingen resigned in 1965, and entered private law practice here.

Mr. Nestingen was born in Sparta, Wis. He served in the Army in the South Pacific in World War II. Later, he earned a doctorate in history and a law degree at the University of Wisconsin. He practiced law in Madison until 1956, when he was elected mayor of that city.

He was an opponent of the late senator Joseph R. McCarthy (R. Wis.) at the time McCarthy claimed to be finding "reds" in the State Department and elsewhere in government.

Mr. Nestingen's survivors include his wife, the former Geraldine Krawczak, of the home in Washington; three daughters, Leslie, Marcia and Aimee, all of the home; and four brothers, Edward of Urbana, III., Stanley and Lyle, both of Madison, and John, of Baldwin, Wis. A fourth daughter, Laurel, died in 1974.

The family suggests that expressions of sympathy be in the form of contributions to Projects for the Poor, Community for Nonviolence, 1329 N St. N.W., Washington, 20005.