A weekend in Nice doesn't give you much time to visit the entire French Riviera, but certainly enough to get to know its informal capital, and even the Principality of Monaco. Rather, no one visits Nice for a literal weekend, or three days from Friday to Sunday.
Is 4 nights in Nice enough?
You will be visiting the area during the Cannes Film Festival and just a few days before the GP in Monaco, so both of those destinations will be very busy. A 4 or 5 day visit will give you an a nice taste of the area.
Is 5 days in Nice too long?
You can never have too long in Nice, so many things to do and places to visit in Nice and surrounding area, plus many eateries and bars to try. Definitely not especially if you are a 1st time visitor. Of course this is assuming you are planning to visit Monaco, Cannes, Eze etc during your 6 days.