The “Modern Family” season finale was customarily madcap — perhaps a little too much so — for most of the episode. And then, as the show so often does, it managed to put a lump in your throat, to abruptly shift gears and find a strain of emotion that was moving without being sappy. It was also, in its own way, another blow for the marriage-equality movement, and a timely one at that, coming on the heels of several court victories and the same day as a new Gallup poll that found support for same-sex marriage at an all-time high, with disproportionate acceptance among younger adults.

The show encapsulated the reason for that in its closing moments (and SPOILER ALERT if you haven’t watched), when Ed O’Neill’s crusty father, Jay, not only rescued the thrice-postponed marriage of his son Mitchell (Jesse Tyler Ferguson) to longtime partner Cam (Eric Stonestreet) by securing space at his country club, but extended an arm and walked Mitchell down the aisle. For all the snide remarks and botched attempts to insist the plagues preventing Mitchell’s nuptials weren’t the wrath of God, Jay thus became the surrogate for many a parent of his generation whose prejudices eroded upon discovering a kid of his or hers is gay.

Moreover, as USA Today’s Robert Bianco noted, the series managed to convey all of that without feeling like one of those dreaded “very special episodes” — without abandoning its other characters or hammering home a message. Mitch and Cam have been a couple from the beginning, with a child who (thank you, Aubrey Anderson-Emmons) increasingly steals scenes and gets some of the best lines; this was simply the logical next step.

In a broader sense, while many shows have tried to replicate the program’s mixture — zany comedy, garnished with heart — few of the many imitators launched since “Modern Family” became an almost-instant success have mastered the deceptively difficult formula.

For all that, the ABC series itself wasn’t as consistently at the top of its game in its fifth season. At its worst, it’s still funnier than most half-hours on TV — and its Vegas episode was surely a highlight of just how deliciously intricate the show can still be — but after being anointed best comedy for four consecutive years, nobody should shed any tears if someone else finally catches the bouquet this season.

On Wednesday, though, “Modern Family” offered a reminder of why it has earned all those accolades. And that — along with the happy couple — is surely an accomplishment worth toasting.