NBC won Monday in ratings, as ABC topped in viewers. The next-to-last episode of “How I Met Your Mother” episode had primetime’s biggest gains, increasing by 17 percent in the key demographic from last week.

NBC had a 3.4 rating/10 share in the advertiser-coveted 18-49 demographic, and was second in viewers with an average of 12.1 million, according to preliminary numbers. “The Voice” at 8 p.m. earned a 3.6/10 — the highest-rating of the night — and 12.6 million viewers. “The Blacklist” at 9 received a 2.9/8 and 11 million viewers.

ABC was second in ratings with a 2.1/6, and first in viewers with 12.8 million. “Dancing With the Stars” earned a 2.2/6 and 14.3 million viewers — the most of the night. “Castle” at 10 got a 1.7/5 and 9.8 million viewers.

CBS was third in ratings with a 2.0/6 and in viewers with 6.9 million. “How I Met Your Mother” earned a 3.4/11 and 9.1 million viewers at 8. At 8:30, “2 Broke Girls” received a 2.3/7 and 7.3 million viewers. “Mike & Molly” got a 2.0/6 and 7.8 million viewers. “Mom” at 9:30 had a 1.9/5 and 7.4 million viewers. “Intelligence” at 10 received a 1.2/3 and 5 million viewers.