Malaga's first home win against Real in almost 30 years was sweet revenge for Pellegrini, sacked by the nine-times European champions at the end of the 2009-10 season and replaced by current coach Jose Mourinho.
It cut the gap to the third-placed Madrid club to only two points with 17 matches played and put Malaga three clear of Real Betis, beaten 2-1 at home by Real Mallorca.
Malaga are also through to the Champions League last 16 on their debut and have a tie against Mourinho's former club Porto to look forward to when the competition resumes in February.
"It's great to end the year like this," Chilean Pellegrini told a news conference. "It has been a brilliant year.
"We qualified for the Champions League, then we won our group, we're in the fight for the Champions League qualification places and then we beat Real Madrid here after so many years.
"It's an enormous source of joy for us," he added.
Malaga's surprise, but deserved, victory against Real came a day after UEFA banned them from future European competition for at least a season because of unpaid bills.
The club appeared to be slipping into crisis over the close season when several of their best players were sold and reports that owner Sheikh Abdullah Bin Nasser Al Thani was looking to sell up were initially met with silence.
The club eventually announced an "internal restructuring" designed to help it comply with new UEFA rules on curbing excessive spending and Al Thani indicated he was committed to the project.
They have vowed to fight the UEFA sanction in the courts, accusing European soccer's governing body of making them a "scapegoat", and say they are paying off any outstanding debts according to agreed timetables.
Pellegrini, known as "the engineer", has been an unflappable source of stability through the turmoil and has managed to get the best out of players like promising Spain Under-21 playmaker Isco and former Spain winger Joaquin.
They have a solid defence marshalled by captain Weligton and Martin Demichelis while Wally Caballero showed with a couple of fine saves on Saturday why he is keeping Cameroon international Carlos Kameni out of the side.
"It's a very harsh decision," Pellegrini said of UEFA's sanctions.
"Personally I don't think we should have ever got into these difficulties with UEFA.
"Let's see how things develop, it's still early to talk about this issue.
"Playing the second half of the season without any goals or motivation would be very hard for the club.
"We have to be concerned but the squad is prepared to overcome any adversity.
Malaga rewarded fans with a memorable 1-0 home win against seven-times European champions AC Milan in October and their performance against Real on Saturday suggests things could get even better for the Andalusian side over the rest of the season. (Reporting by Iain Rogers, editing by Ken Ferris)
- Sports & Recreation