The rule on a tagline is really not significantly different from that on a logo, or brand name. If anywhere in the packaging, advertising, or promotion of a product or service, a registered or protected trademark of another is used, without permission from the holder, in such a way that a reasonable consumer might plausible believe that the product is made by the same maker, or comes from the same source, as the product associated with the trademark, or that the product has been approved or endorsed or sponsored by the mark holder, that would be trademark infringement.
Phrases such as "inspired by" or "google-style" might have such an effct, depending on the whole of the circumstances.
A disclaimer, such as "This film is in no way approved or enforced by the creators of Star Wars, it merely uses similar ideas" might, if sufficiently prominent, help avoid possible confusion. Comparative advertising such as "far more exciting than Star Wars ever was" generally makes it clear that the item is not endorsed, and indeed is to some extent competitive. That is generally considered an example of nominative use and is not infringement.
But the more similarity is implied, the more consumer confusion is invited, and the more the new product seems to trade on the reputation of the established product. That is exactly what a trademark is intended to prevent.