In California, UPL has a flexible definition and is analyzed situationally, as is the formation of an attorney-client relationship. The shorthand definition for UPL is usually given as something like "doing what lawyers do." When your "help" goes beyond "studying law" and begins to deal with applying that law to a particular legal matter, you're definitely in the neighborhood. If you're encouraging people to compensate you monetarily, even on the sly (or perhaps especially on the sly) that's just going to make it shadier.
There's no clear line that divides "assistance" from "advice" or "information" from "counsel." You're not going to find a statute or professional rule that helpfully explains just how close you can get to UPL through wink-wink-nudge-nudge "unofficial-but-maybe-you-should-still-pay-me" legal "information-but-not-advice" before liability attaches, which seems to be the drift of the question (although I understand it was edited).
People v. Merchants Protective Corp., 209 P.363, 365 (1922)
'As the term is generally understood, the practice of the law is the doing or performing services in a court of justice, in any matter depending therein, throughout its various stages, and in conformity to the adopted rules of procedure. But in a larger sense it includes legal advice and counsel, and the preparation of legal instruments and contracts by which legal rights are secured although such matter may or may not be depending in a court.' Quoting In the case of Eley v.Miller, 7 Ind. App. 529, 34 N. E. 836.
Baron v. Los Angeles, 2 C.3d 535, 86 C.R. 673, 469 P.2d 353 (1970).
"(T)he Legislature adopted the state bar act in 1927 and used the term 'practice law' without defining it. [FN7] The conclusion is obvious and inescapable that in so doing it accepted both the definition already judicially supplied for the term and the declaration of the Supreme Court (in 'Merchants') that it had a sufficiently definite meaning to need no further definition. The definition above quoted from People v. Merchants' Protective Corp. has been approved and accepted in the subsequent California decisions (citations), and must be regarded as definitely establishing, for the jurisprudence of this state, the meaning of the term 'practice law." (People v. Ring (1937) supra. 26 Cal.App.2d Supp. 768, 772, 70 P.2d 281, 283.)
For comparison, the Texas Bar's UPL Committee has a digest of the applicable statutes and rules here (they also provide a few appellate decisions that might interest you).
In terms of legitimately paid non-attorney help with preparing documents and the like, here's a long discussion on avoiding UPL from a Legal Document Assistant trade association site.
Realistically, UPL is investigated in retrospect, mostly in response to complaints. The proper context to analyze this hypothetical is to envision the non-client furious at the non-lawyer after the case has been lost. If everything goes well the non-lawyer probably gets his "gift" and the State Bar is none the wiser. (Although I suppose there's the further wrinkle that if the non-client wins and doesn't provide the "gift" then the non-lawyer likely has no good remedy).