In the 2003–04 season, McCourt managed just a handful of starts for the club and had two spells away on trial with First Division clubs Norwich City and Crewe Alexandra, though neither club followed up their initial interest in him. A combination of injuries and loss of form hastened his departure from Rochdale in February 2005.
In March 2005, McCourt was signed by Roddy Collins, manager of League of Ireland club Shamrock Rovers. McCourt scored three goals in his first six appearances for the Dublin club and topped the goalscoring charts by May 2005. As the club ran into financial difficulty, mainly due to the costs surrounding the building of Tallaght Stadium, Rovers were forced to place all players except McCourt on the transfer list. After seven goals in 17 appearances, and following interest from Bristol City and Queens Park Rangers, the club, in dire need of funds, decided to sell McCourt. He was signed by his home-town club, Derry City, for a fee thought to be around £60,000. Despite leaving the club halfway through the season, McCourt was their top goalscorer that season and won the Professional Footballers Association of Ireland Young Player of the Year award.
In his first few months at the club, McCourt helped Derry City to the League of Ireland Cup and runners-up in the league in 2005. In the 2006 season, he played in Derry's UEFA Cup run, in which the club eventually lost to French giants Paris Saint-Germain, and helped them to win a cup double with victories in both the FAI Cup and League of Ireland Cup finals. McCourt scored four goals in 25 appearances in the 2007 season and won a third League of Ireland Cup medal. His performances interested English club West Bromwich Albion and Derry announced in June 2008 that they had reached an agreement with the newly promoted Premier League club. However, Derry also agreed a fee with Scottish Premier League club Celtic, leaving McCourt to make his choice.