It is not entirely clear to me what you want but perhaps this goes in the right direction. You can reprogram the scatter
code to draw the stair-like plot.
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17,
stair plot/.code={\pgfplotsset{stairs/.cd,#1}%
\def\myvalue##1{\pgfkeysvalueof{/pgfplots/stairs/##1}}%
\pgfmathsetmacro{\mydx}{(\myvalue{xmax}-\myvalue{xmin})/(\myvalue{n})}%
\pgfmathsetmacro{\mydy}{(\myvalue{ymax}-\myvalue{ymin})/(\myvalue{m})}%
\pgfmathsetmacro{\myxmin}{\myvalue{xmin}+\mydx/2}%
\pgfmathsetmacro{\myymin}{\myvalue{ymin}+\mydy/2}%
\pgfmathsetmacro{\myxmax}{\myvalue{xmax}-\mydx/2}%
\pgfmathsetmacro{\myymax}{\myvalue{ymax}-\mydy/2}%
\pgfplotsset{domain=\myxmin:\myxmax,domain y=\myymin:\myxmax,
samples=\myvalue{n},samples y=\myvalue{m},
scatter,only marks,mark=none,
scatter/@pre marker code/.append code={%
\pgfmathsetmacro{\myx}{\pgfkeysvalueof{/data point/x}}%
\pgfmathsetmacro{\myy}{\pgfkeysvalueof{/data point/y}}%
\pgfmathsetmacro{\myz}{\pgfkeysvalueof{/data point/z}}%
\path[3d bar/x face] (axis direction cs:\mydx/2,\mydy/2,0) --
(axis direction cs:\mydx/2,\mydy/2,-1*\myz) --
(axis direction cs:-\mydx/2,\mydy/2,-1*\myz) --
(axis direction cs:-\mydx/2,\mydy/2,0) -- cycle;
\path[3d bar/y face] (axis direction cs:\mydx/2,\mydy/2,0) --
(axis direction cs:\mydx/2,\mydy/2,-1*\myz) --
(axis direction cs:\mydx/2,-\mydy/2,-1*\myz) --
(axis direction cs:\mydx/2,-\mydy/2,0) -- cycle;
\path[3d bar/z face] (axis direction cs:\mydx/2,\mydy/2,0) --
(axis direction cs:\mydx/2,-\mydy/2,0) --
(axis direction cs:-\mydx/2,-\mydy/2,0) --
(axis direction cs:-\mydx/2,\mydy/2,0) -- cycle;
},
}%
},
stairs/.cd,
xmin/.initial=0,xmax/.initial=5,ymin/.initial=0,ymax/.initial=5,
n/.initial=5,m/.initial=5}
\tikzset{3d bar/.cd,
x face/.style={draw=blue!50,fill=cyan!30},
y face/.style={draw=blue!50,fill=cyan!50},
z face/.style={draw=blue!50,fill=cyan!10}}
\begin{document}
\begin{tikzpicture}[declare function={f(\x,\y)=3*exp(-\x/5-\y/4);},% function
/pgfplots/.cd,view={120}{40},
xmin=0,xmax=6,
ymin=0,ymax=6,
zmin=0
]
\begin{axis}
\addplot3[stair plot={n=5,m=5}] {f(x,y)};
\end{axis}
\begin{axis}[yshift=6cm]
\addplot3[surf,shader=interp,domain=0:5,domain y=0:5] {f(x,y)};
\end{axis}
\begin{axis}[xshift=8cm]
\addplot3[stair plot={n=25,m=25}] {f(x,y)};
\end{axis}
\begin{axis}[xshift=8cm,yshift=6cm]
\addplot3[surf,shader=interp,domain=0:5,domain y=0:5] {f(x,y)};
\end{axis}
\end{tikzpicture}
\end{document}

Or
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17,
stair plot/.code={\pgfplotsset{stairs/.cd,#1}%
\def\myvalue##1{\pgfkeysvalueof{/pgfplots/stairs/##1}}%
\pgfmathsetmacro{\mydx}{(\myvalue{xmax}-\myvalue{xmin})/(\myvalue{n})}%
\pgfmathsetmacro{\mydy}{(\myvalue{ymax}-\myvalue{ymin})/(\myvalue{m})}%
\pgfmathsetmacro{\myxmin}{\myvalue{xmin}+\mydx/2}%
\pgfmathsetmacro{\myymin}{\myvalue{ymin}+\mydy/2}%
\pgfmathsetmacro{\myxmax}{\myvalue{xmax}-\mydx/2}%
\pgfmathsetmacro{\myymax}{\myvalue{ymax}-\mydy/2}%
\pgfplotsset{domain=\myxmin:\myxmax,domain y=\myymin:\myxmax,
samples=\myvalue{n},samples y=\myvalue{m},
scatter,only marks,mark=none,
scatter/@pre marker code/.append code={%
\pgfmathsetmacro{\myx}{\pgfkeysvalueof{/data point/x}}%
\pgfmathsetmacro{\myy}{\pgfkeysvalueof{/data point/y}}%
\pgfmathsetmacro{\myz}{\pgfkeysvalueof{/data point/z}}%
\path[3d bar/x face] (axis direction cs:\mydx/2,\mydy/2,0) --
(axis direction cs:\mydx/2,\mydy/2,-1*\myz) --
(axis direction cs:-\mydx/2,\mydy/2,-1*\myz) --
(axis direction cs:-\mydx/2,\mydy/2,0) -- cycle;
\path[3d bar/y face] (axis direction cs:\mydx/2,\mydy/2,0) --
(axis direction cs:\mydx/2,\mydy/2,-1*\myz) --
(axis direction cs:\mydx/2,-\mydy/2,-1*\myz) --
(axis direction cs:\mydx/2,-\mydy/2,0) -- cycle;
\path[3d bar/z face] (axis direction cs:\mydx/2,\mydy/2,0) --
(axis direction cs:\mydx/2,-\mydy/2,0) --
(axis direction cs:-\mydx/2,-\mydy/2,0) --
(axis direction cs:-\mydx/2,\mydy/2,0) -- cycle;
},
}%
},
stairs/.cd,
xmin/.initial=0,xmax/.initial=5,ymin/.initial=0,ymax/.initial=5,
n/.initial=5,m/.initial=5}
\tikzset{3d bar/.cd,
x face/.style={draw=blue!50,fill=cyan!30},
y face/.style={draw=blue!50,fill=cyan!50},
z face/.style={draw=blue!50,fill=cyan!10}}
\begin{document}
\begin{tikzpicture}[declare function={f(\x,\y)=3*exp(-\x/5-\y/4);},% function
/pgfplots/.cd,view={120}{40},
xmin=0,xmax=6,
ymin=0,ymax=6,
zmin=0,xtick=\empty,ytick=\empty,ztick=\empty,
xlabel={$x$},ylabel={$y$},zlabel={$z$}
]
\begin{axis}
\addplot3[stair plot={n=14,m=14},opacity=0.5] {f(x,y)};
\path (0,4,2) node{$n=14$};
\end{axis}
\begin{axis}[colormap/bluered]
\addplot3[surf,shader=interp,domain=0:5,domain y=0:5,opacity=0.5] {f(x,y)};
\end{axis}
\end{tikzpicture}
\end{document}

Package pgfkeys Error: I do not know the key '/tikz/3d bar/dx/.evaluated'
upon compilation./.evaluated
key exists only in newer pgf versions. Probably you are using an older one.