Is 95 minutes enough transfer time at Newark (ewr) incoming at terminal B from Cancun, outgoing from terminal B for Oslo?
Flying United all the way.
The physical movement between the two terminals doesn't require much time, maybe 10 minutes. The most time-consuming part of what you're doing is clearing U.S. Customs and Immigration. The time required for that step varies widely, but can take several hours.
If you're a U.S. Citizen or resident, plan on having 2-3 hours, just to be on the safe side. Add an hour if you're a citizen of another country. You'll need to pick up your luggage and re-check it after passing through U.S. Customs and Immigration. The passport control checkpoint by itself can require over an hour in line (but the passport check itself is short, even shorter if you're a U.S. Citizen).
The 95 minutes you have between your connections is probably too short, especially if you're traveling at a busy time.
It's risky but if United sold you this itinerary as a single ticket, there is a good chance you will make it. The airline is responsible for getting you to your final destination and a missed connection on an international flight is a head ache for United. So they typically track connection times carefully and will only book itineraries that have a decent chance of actual working.
As ColeS pointed the major problem are US immigration and another pass at security. These are out of control of the airline and fairly unpredictable. I once made a 25 minute connection (inbound from HKG delayed) but only since I had Global Entry, TSA PreCheck, no checked luggage, and can run reasonable fast.
If this is NOT a single itinerary on single ticket, I would strongly advice to rebook (if it's still possible at a reasonable price).