Below is from AC 61-142, the rule is 61.113c. The answer to your question is cost sharing is allowed, the private pilot should not pay less than 50%.
7.1 Sharing Expenses. A private pilot may not pay less than the pro rata share of the
operating expenses of a flight with passengers, provided those expenses involve only
fuel, oil, airport expenditures, or rental fees. A pilot exercising private pilot privileges
who accepts any reimbursement that exceeds the pilot’s pro rata share of the operating
expenses of a flight would be paying less than the pilot’s pro rata share, and thus would
be violating the limits of the expense-sharing provision of § 61.113(c). Additionally,
§ 61.113(c) permits reimbursement of expenses only from the passengers on the flight.