Even if 52 minutes is legal, I would not risk it. That leaves absolutely zero room for Murphy's Law. What happens if there is a gate change and your SLC-JFK flight now arrives at T2 but the JFK-GRU flight leaves from the Florida end of T4? (Or vice-versa)
While the airfare SLC-JFK-GRU may be cheapest compared to routing through ATL or DTW, what is the total cost if you have to spend a night in NYC? Does it become more of a wash to route through DTW/ATL if the connections are reasonable?