TITLE: Two pullback diagram
QUESTION [11 upvotes]: Suppose whole square and the left square in the diagram below are pullbacks, then we may wonder whether the right square is a pullback. It is usually not the case. 

Now we seek some addition condition on $X\to Y$ that forces the right square is a pullback too. 
My question: is epic a sufficient condition? (If the category is Sets, then yes.)
Added: Let $P$ be the pullback of the right square, then there exists $B\to P$, and the square $A\to P \to Y$ // $A\to X \to Y$ is a pullback, so we have the following diagram in which the bottom and the whole squares are pullback, so is the upper square. If the category is Sets, $X\to Y$ is surjective then $A\to P $ is also surjective. Since the pullback of $B\to P$ along a surjective map is an bijection, $B\to P$ must be a bijection. This shows the right square of the original diagram is a pullback. We can also see why we consider some nice condition on $X\to Y$.

REPLY [11 votes]: I tried to write the explanation of the comment about a dozen of times, but was never satisfied with the result. Finally, I decided to write a full note (I will try to put it on arXiv in a few minutes; here it is) describing the natural setting for such questions:
http://www.mimuw.edu.pl/~mrp/the_other_pullback_lemma.pdf
(the note still needs some improvements, but I am running out of time now...)
I found it easier to characterise your condition by "extremal epimorphisms" rather than "strong epimorphisms" (notice however, that in case of finite connected limits, these concepts coincide). Here is the formal statement:
Let us assume that finite connected limits exist. The following are equivalent:

your condition along $e \colon X \rightarrow Y$ holds 
$e \colon X \rightarrow Y$ is an extremal morphism stable under pullbacks.