Pitbull is invoking the little known ‘Seacrest Defense’ in his legal battle with Lindsay Lohan — claiming in new docs that if Ryan Seacrest didn’t sue him for mentioning him in a song … LiLo shouldn’t either!

As TMZ first reported, Lindsay is suing Pitbull (along with Ne-Yo and Afrojack) for namedropping her in the song “Give Me Everything.” She claims the lyric –– “I got it locked up like Lindsay Lohan” — caused her “irreparable harm.”

In legal docs filed this week in New York, Pitbull responded to the suit and pointed out that he rapped about Seacrest in the same song — and noted Ryan not only didn’t sue, but Pitbull performed the song as part of a New Year’s Eve show … hosted by Seacrest!

Translation — Seacrest has a sense of humor, Lindsay does not.

Pitbull also cited the lesser known First Amendement in his bid to get the case dismissed.

A judge has yet to rule.