Just weeks from the first nominating contests in the country, Democratic candidates Hillary Clinton and Bernie Sanders are nearly head-to-head in Iowa and New Hampshire, according to a new poll released Sunday.

An NBC/Wall Street Journal/Marist survey shows that, among likely Iowa Democratic caucus-goers, Clinton edges out the Vermont senator by just three points, 48 percent to 45 percent -- a lead within the poll's margin of error of 4.8 percentage points. Former Maryland Gov. Martin O'Malley comes in with five percent of support.

Sanders' numbers have creeped up on Clinton since the last survey was taken in October, when the former secretary of state had an 11 point lead over Sanders.

Get Breaking News Delivered to Your Inbox

The Vermont senator has also eclipsed her in general election match-ups with top Republican contenders in the state. While Clinton tops Trump by eight points among registered voters (48 percent to 40 percent), Sanders leads him by 13 points (51 percent to 38 percent). Texas Sen. Ted Cruz leads Clinton by four points at 47 percent to 44 percent but loses to Sanders by five (42 percent to 47 percent).

Among likely Democratic primary voters in New Hampshire, Sanders trumps Clinton by just four points. At 50 percent to the former secretary of state's 46 percent, Sanders' narrow lead is also within the poll's margin of error of 4.8 percent.

The poll shows Clinton is gaining on Sanders in the Granite State, where he once held a lead of nine points over the former secretary.

Similar to Iowans, likely New Hampshire voters give Sanders a greater edge than Clinton over Republicans Trump and Cruz. Clinton-Trump results in a near tie of 45 percent to 44 percent, with Sanders-Trump at 56 percent to 37 percent. Cruz bests Clinton by four points, but loses to Sanders by 19.

The race among Republicans in the early-voting states is also tight, with Cruz polling slightly ahead of national front-runner Trump in Iowa, where caucuses will be held on Feb. 1.

Cruz leads Trump by four points among likely Republican caucus-goers at 28 percent to 24 percent, within the margin of error of 4.6 percentage points. Florida Sen. Marco Rubio gets 13 percent of support, while Ben Carson trails behind at 11 percent. No other candidates break five percent in Iowa.

In New Hampshire, Trump remains at the top of the pack with 30 percent of likely Republican primary voters throwing in their hats with him.

Rubio follows in second place at 14 percent, New Jersey Gov. Chris Christie at 12 percent, and Cruz at 10 percent. Former Florida Gov. Jeb Bush and Ohio Gov. John Kasich are tied with nine percent of support each.