She was the first member of the Communist Party of Canada to be elected to the Canadian House of Commons, serving during World War II. She was the third woman elected to Canadian Parliament and the first to still be raising young children while holding political office. She won a seat in the 1940 federal election representing the Saskatchewan riding of North Battleford on the "Unity" label, beating the Liberal candidate in a two-way race. Because of Communist opposition to the war the Canadian Government became the only western democracy to ban the Communist Party in June of 1940. Nielsen, through indirect contact with Montreal-based Communist leaders who had escaped imprisonment, became a spokeswoman for the Communist Party through speeches made in the House of Commons.
She ran for re-election in the 1945 election for the Labour Progressive Party (the name the Communist Party used between 1941 and 1959), but came in third behind the Cooperative Commonwealth Federation and Liberal candidates with 13% of the vote.