In general a visit to Canada, Mexico or Caribbean countries does not reset the 90 day clock on a visa waiver. However this is actually not a hard and fast rule, as indicated by the US Customs and Border Protection website.
The purpose of this rule is to prevent people extending their stay in the US indefinitely by doing a 'visa run' to a nearby country every 90 days. If you are clearly not trying to do this then you will likely be OK. This is how the US CBPA phrases it:
If you go to Canada and Mexico or the Caribbean, and while you are there, your initial 90-day period of entry expires, but you need to come back in to the U.S. to fly home, you may encounter a problem. The terms of the VWP are very clear - it is only to be used for occasional, short visits to the U.S. If the CBP Officer thinks you are trying to "reset" the clock by making a short trip out of the U.S. and re-entering for another 90-day period, you can be denied entry. (If that happens, you will have to obtain a visa for any future travel to the U.S.) In order to be re-admitted to the U.S. shortly after a previous admission expired, you will have to convince a CBP Officer that you are not trying to "game" the system.
In other words, it is up to the immigration officer to decide if you are genuinely only making "occasional, short visits to the U.S", and up to you to convince her that is the case. In your case, where you have visited the US briefly, spent a long time in Canada and then intend to visit the US briefly again, I would expect you to have no trouble. I would recommend making sure you have the details of your last visits to the US (not forgetting any brief visits while you were staying in Canada) to present to the official, as well as proof of your intended departure from the US, such as an airline ticket.
In the general case I would expect that the longer the stays in the US, and the shorter the stay in Canada, the more trouble someone is likely to have.
Summary: You should be OK as long as you can show you are genuinely only making "occasional, short visits to the U.S"