From 1985 to 1987 Dewar was president of the federal NDP, succeeding Tony Penikett. She was elected to the House of Commons of Canada in a 1987 by-election in the riding of Hamilton Mountain, replacing NDP incumbent Ian Deans. She had been invited to the riding in the hopes that, as a star candidate, she would keep the riding in NDP hands, but she faced strong competition for the nomination from future MP David Christopherson. She was defeated in the 1988 general election, losing to Liberal Beth Phinney by only 73 votes.
