We study the problem of minimizing the cost of packet transmission from a source to two receivers with the help of a relay and using network coding in wireless mesh networks consisting of many active neighbours sharing the same channel. The cost minimization problem is modelled as a Markov Decision Process (MDP) and analysed under different network conditions. Two simple heuristics are proposed to estimate the appropriate time for activating the relay to provide close-tooptimal performance. Our numerical results show that a judicious network coding enabled relay can bring up to 2.9x gains in the presence of active neighbours compared to multicasting directly from the source. We further show that in scenarios which the links between relay and destinations are not better than the links between source and destinations, a relay can still provide up to 1.7x gain.