Although this episode is numbered as #22, and was actually the last new episode to be aired, it was not meant to be the final episode of the series.
The actual series finale was episode #18, "Three Weddings and a Meltdown", a feel-good episode that offered happy endings all around.
So how did four more episodes wind up showing after the series finale?
CBS had canceled the show, and was eager to replace it with a higher-rated new series, so they officially ended its run on April 24 by airing the series finale, without having entered the previous episodes.
There was a possibility that those episodes might have never been shown, once the show was canceled. But when summer arrived, CBS dug them up and broadcast them in June, probably thinking that brand new, unaired episodes of the acclaimed show get better ratings than the typical reruns that usually dominated TV in the summer time.
But it's clear from the various plots in those last four episodes that they were originally meant to be aired before the series finale, not after. Character arcs (such as Wambaugh's troubled marriage, and Kenny & Maxine's off & on romance) that were finally resolved in that series finale were suddenly unresolved again in these belated episodes.
So, although episodes 19 - 22 are listed as the show's last four episodes, episode 18 should really be listed as the final episode of the series, regardless of when it aired.
Last show of the series.