The ALP has won a lot of elections in the last decade: 16 wins for just one loss at state level (another six wins and no losses in the territories). But few of them have confounded expectations as much as Saturday’s victory in Queensland.

That’s good news for Labor in New South Wales, which goes to the polls in exactly two years time. The NSW government needs all the good news it can get: the most recent Newspoll has it trailing 56%-44% (two-party preferred), a swing of more than 8% since the 2007 election, and most commentators seem to have written it off.

Although participants usually say that each election is fought on local issues, state elections have generally followed an identifiable pattern.

New South Wales has been at the leading edge of the cycle, electing a Labor government narrowly in 1995, which then won a landslide in 1999 and was comfortably re-elected in 2003 — followed in each case by the other states, Western Australia excepted (South Australia has not yet reached the third stage, but no-one doubts that its government will be re-elected in 2010).

Queensland and NSW are the only ones to have yet reached the next stage, with their governments winning fourth terms in 2006 and 2007 respectively. Now Queensland (which has caught up to NSW because it has three year terms) has given Labor a fifth term.

Could NSW do the same? The betting must still be against it; the state’s public services are in appalling shape, and Labor has displayed an ineptitude far in excess of its record in any other state. But two years is a long time and the chances of a recovery should not be rejected out of hand.

The opposition’s target in NSW is very similar to the one it faced in Queensland — a swing of about 7% (the pendulum in both cases is heavily weighted in Labor’s favor). Each is complicated by the presence of a large contingent of independents. Although Liberal leader Barry O’Farrell does not have Lawrence Springborg’s problem of trying to win over urban votes as a rural conservative, he does have a sometimes restive National Party breathing down his neck.

Precisely because things have been so bad for so long, voters in NSW have low expectations. Even a modest improvement could be enough to put the incumbents back into contention.

Queensland also offers support for a tactic NSW Labor seems to be considering: to try to help its chances by installing a female premier, presumably current deputy Carmel Tebbutt.

Whether or not that actually made a difference in Queensland is pretty much irrelevant; because the result was historic, with the first elected woman premier, it is seen to have been important, and it’s the perception that matters. Female leaders could benefit from a bandwagon effect, conferring some freshness on even the stalest of governments.

If that, or something, manages to rescue NSW Labor two years hence, it will be one of the great political comebacks of all time.