Stopping off the train in Coimbra for a few hours is more hassle than it looks at first glance. First of all, high speed trains (the ones from Lisbon to Porto) don't stop at the little Coimbra station - they stop at Coimba B, which is a little outside of town. To get to the little Coimbra station, you need to take a spur train - just a short ride, but it is a little change and a delay.
Second, as I recall (was in Coimbra in May) there's no official luggage storage there, at either station. Your best bet might be "unofficial" storage: leave it at a hotel or cafe for a few hours. There used to be a cafe in Coimbra that would do this, but I think the place has since closed. There is a hotel right across the street (can't remember the name) that might do it. I did something just like this in Tomar: left my bags for a few hours at a hotel near the station. (They were happy to do it and would not accept any payment for it.) I wouldn't stress over this - improvise a little, you'll find a place to leave bags. Just be prepared for it.
It might be easier to day trip back from Porto to Coimbra. Some of the regional trains between Porto Campanhã station and Coimbra go directly to the little Coimbra station (in Porto - you do have to get from the little Sao Bento station to Campanhã, another short ride on local trains). Even though the regional trains take a little longer, because there's no layover at Coimbra B, effective travel time may not be much different. In May, I had to go between Porto and Coimbra twice (long story) and took both regional and IC trains each way. I thought the regional trains were more comfortable even if a little slower. They weren't full, and I had plenty of room to spread out. And - cheaper than the regional trains, even if not by much.
I would ask: why five nights in Porto? I had three, which included one day penciled in for a day trip to the Douro Valley, but it rained so I just stayed in Porto. Otherwise, two nights would have been plenty. Five nights in Lisbon sounds good.
I didn't rent a car, but I understand driving is easy in Portugal, and for four people it makes some sense (I traveled alone, and I like trains, so the train was fine for me). I'd probably rent the car as you leave Lisbon and drop it in Porto with some stops in between as you say but do fewer nights in Porto, unless you've got plenty of day trips lined up.