Preston went ahead through Jon Macken 90 seconds into the second half.
But City soon hit back with goals from Shaun Wright-Phillips, Steve Howey and Paulo Wanchope.
They missed several more chances before Iain Anderson hit an injury-time goal that gave the result a flattering scoreline.
"I was very pleased with our performance," said Keegan. "But both sides deserve credit for a great game, particularly given the state of the pitch which was holding water at the end.
"We had to show a lot of different qualities today as well. We had to come back from a goal down but we then scored three great goals and I thought we thoroughly deserved the win."
Keegan had words of praise for both Wanchope and Howey, who both returned after absences and got on the score sheet.
"I've seen Paulo run defences ragged and he'll get better and better as he wants to improve. He scored a great goal and he's too good a player not to be playing for Manchester City when they are in the first division. He's a Premiership player.
"I'm glad Stevie's back too as he gives us something extra. It was a difficult game for him to come back in and he started a little bit dodgy.
"But he then got his act together. He's a Premiership player too, no doubt about it."