“Community” has squeaked out a fifth season renewal from NBC. And the Greendale Community College gang undoubtedly owes a debt to the expanding SVOD marketplace for persuading NBC that it was worth investing in what will probably be a last hurrah for the cult-fave series from Sony Pictures TV.

If NBC had canceled the show, Sony TV undoubtedly would have leveraged the rabid, if small, fan following into new production in some form on a content-hungry digital platform like Netflix, Hulu or Amazon. That certainly surely put pressure on the Peacock to greenlight a new season, despite the show’s modest ratings. Otherwise, a rival outlet would have made plenty of hay out of “saving” a show that was built up on NBC.

The oddball Joel McHale-starrer had its fourth-season finale Thursday.

“Community” has seen a steady slide in ratings since its 2009 debut. The program averaged 5 million viewers during its first run on NBC, but dipped to 4.4 million and 4 million viewers in seasons two and three, respectively, even in its enduring Thursday 8 p.m. timeslot. These sliding numbers have not helped “Parks and Rec,” which relies on “Community” as a lead-in.

In its fourth season, “Community” hits about a 1.0 in adults 18-49 most weeks, facing stiff competition from CBS juggernaut “The Big Bang Theory,” which routinely sweeps in the timeslot.

Comedy, created by Dan Harmon, has attracted a devoted fan base, but also a slew of PR troubles along the way. Harmon was forced out as showrunner after season three primarily because of low ratings and production issues. He also had a well-publicized feud with cast member Chevy Chase.

The show had a long murky hiatus during the 2011-12 season that led many fans to petition for its return on social media. Peacock announced the return of “Community” last year with a new showrunners, but then once again delayed its skedded Oct. 19 premiere date until February.

During season four’s lensing, Chase’s contentious relationship with the comedy’s cast and crew came to a head, and ultimately ended with him leaving the show mid-production.

Comedies with cult-like followings that have met the ax on broadcast nets are increasingly finding second life in cable or digital outlets, such as “Futurama’s” migration to Comedy Central and “Arrested Development’s” return later this month on Netflix.