City dropped points away from home in the Premier League for the first time this season at Selhurst Park and would have lost the match were it not for a late penalty save by Ederson.
Guardiola was unhappy with aspects of his team's performance and Sterling says he was subjected to some stern words in the dressing room after failing to make an impact off the bench.
"He lets you know when he's not happy with you," Sterling told a news conference. "I remember coming on against Crystal Palace. I lost the ball three times and I didn't think I was going to play until the end of the season after he killed me in the dressing room.
"A manager like that brings the best out of you, when he makes sure to tell you when you're in the wrong."
That game was a rare ineffective performance from Sterling in 2017-18, with the England forward having excelled for much of City's exceptional campaign.
The former Liverpool man thinks the signing of Bernardo Silva helped to motivate him to become better and keep his place in the team.
"When there's doubt, when it comes to that point, that's where I'm at my best, when I have got competition," he said. "Last summer, I saw Bernardo Silva signed and I thought 'when I get back, I've got to make sure I'm on it because there's more competition'.
"I was looking forward to it. Sometimes you read you might not be in the squad and I think 'okay then, cool, we'll see about that'. Stuff like that brings the best out of me."
Sterling also credited Guardiola with helping to improve his game by simply reminding him of some basics in training.
"When I used to dribble, I'd be on the wing and I'd control it with the outside of my foot – it slows the ball down," he said. "He brings you back to what you used to do with the under-eights, open your body up, gets the rhythm going again – little details like that."
Sterling's form for City – he has scored 20 goals this season – is in stark contrast to that for England, though, the 23-year-old failing to find the net for his national team since October 2015.
Although he admits he should have a better record, Sterling thinks he would benefit from a more consistent backing from the fans as he looks ahead to the World Cup.
"I should be scoring a lot more for England and I put a lot of pressure on myself," he said. "I've done that at my club. I wasn't scoring a lot of goals there as well but made the turnaround and started scoring.
"This is stuff you used to see on TV as a little kid and you get the opportunity to be here now at 23. Just enjoy it. We know what we can do. It's just having that support and that backing – you know, feeling loved.
"I feel sometimes a bit too much negativity. I would love to hear some positive notes going in, just to make the boys know everyone's behind them."