Yes, this is possible, but it might be easier to wall that section up and dig out some new rooms.
Since it's connected to an infinite water source, pumping it out isn't going to work- it'll just flow back in. Instead, give the water somewhere to go. Water can flow off the edges of cavern levels, so we'll use those.
Dig a shaft down to the caverns directly underneath one of the walls of the flooded area. Approach the flooded area from the side (make sure you can seal that tunnel) and dig a channel above the shaft.
You may need to make the shaft larger than 1x1 or dig multiple shafts so the water flows out faster than it can flow in.
Once most of the water has gone, you can put floodgates in to block the leak. Expect to get a lot of job cancellations here- a single tick where the area has 2/7 water will make it too dangerous- but eventually it will work.
Now that the leak is plugged, the water will continue to flow into the caverns until it's all drained. You can block the shaft at this point (or use it to dump rubbish).
You might want to build a new floor for the flooded area. Since it'll be muddy from all the water, you'll get mushrooms if you don't.